// GetCacheStatus returns a TabletCacheStatus representing the current gateway status.
3544
func (tsa *TabletStatusAggregator) GetCacheStatus() *TabletCacheStatus {
	status := &TabletCacheStatus{
		Keyspace: tsa.Keyspace,
		Shard:    tsa.Shard,
		Name:     tsa.Name,
	}
	tsa.mu.RLock()
	defer tsa.mu.RUnlock()
	status.TabletType = tsa.TabletType
	status.Addr = tsa.Addr
	status.QueryCount = tsa.QueryCount
	status.QueryError = tsa.QueryError
	var totalQuery uint64
	for _, c := range tsa.queryCountInMinute {
		totalQuery += c
	}
	var totalLatency time.Duration
	for _, d := range tsa.latencyInMinute {
		totalLatency += d
	}
	status.QPS = float64(totalQuery) / 60
	if totalQuery > 0 {
		status.AvgLatency = float64(totalLatency.Nanoseconds()) / float64(totalQuery) / 1000000
	}
	return status
}
325355
func (r *URIBuilder) StatusCode(code int) *URIBuilder {
	r.cacheStatuscode = code
	return r
}
155620
func (r Virtual_Guest) GetStatus() (resp datatypes.Virtual_Guest_Status, err error) {
	err = r.Session.DoRequest("SoftLayer_Virtual_Guest", "getStatus", nil, &r.Options, &resp)
	return
}
1121310
func (cache *diskBlockCacheWrapped) Status(
	ctx context.Context) map[string]DiskBlockCacheStatus {
	// This is a write operation but we are only reading the pointers to the
	// caches. So we use a read lock.
	cache.mtx.RLock()
	defer cache.mtx.RUnlock()
	statuses := make(map[string]DiskBlockCacheStatus, 2)
	if cache.workingSetCache != nil {
		for name, status := range cache.workingSetCache.Status(ctx) {
			statuses[name] = status
		}
	}
	if cache.syncCache == nil {
		return statuses
	}
	for name, status := range cache.syncCache.Status(ctx) {
		statuses[name] = status
	}
	return statuses
}
1249920
func (a *Client) GetStatus(params *GetStatusParams) (*GetStatusOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetStatusParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "GetStatus",
		Method:             "GET",
		PathPattern:        "/status",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &GetStatusReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*GetStatusOK), nil

}
350873
func (e DiskBlockCacheError) ToStatus() (s keybase1.Status) {
	s.Code = StatusCodeDiskBlockCacheError
	s.Name = "DISK_BLOCK_CACHE_ERROR"
	s.Desc = e.Msg
	return
}
1002910
func (dbcr *DiskBlockCacheRemote) GetPrefetchStatus(
	ctx context.Context, tlfID tlf.ID, blockID kbfsblock.ID,
	cacheType DiskBlockCacheType) (
	prefetchStatus PrefetchStatus, err error) {
	if tmp, ok := dbcr.statuses.Get(blockID); ok {
		prefetchStatus := tmp.(PrefetchStatus)
		return prefetchStatus, nil
	}

	dbcr.log.LazyTrace(
		ctx, "DiskBlockCacheRemote: GetPrefetchStatus %s", blockID)
	defer func() {
		dbcr.log.LazyTrace(
			ctx, "DiskBlockCacheRemote: GetPrefetchStatus %s done (err=%+v)",
			blockID, err)
	}()

	res, err := dbcr.client.GetPrefetchStatus(
		ctx, kbgitkbfs.GetPrefetchStatusArg{
			TlfID:   tlfID.Bytes(),
			BlockID: blockID.Bytes(),
		})
	if err != nil {
		return NoPrefetch, err
	}

	return PrefetchStatusFromProtocol(res), nil
}
887023
func (r Product_Upgrade_Request) GetStatus() (resp datatypes.Product_Upgrade_Request_Status, err error) {
	err = r.Session.DoRequest("SoftLayer_Product_Upgrade_Request", "getStatus", nil, &r.Options, &resp)
	return
}
1236401
func GetAndCacheGateway(db sqlx.Queryer, p *redis.Pool, gatewayID lorawan.EUI64) (Gateway, error) {
	gw, err := GetGatewayCache(p, gatewayID)
	if err == nil {
		return gw, nil
	}

	if err != ErrDoesNotExist {
		log.WithFields(log.Fields{
			"gateway_id": gatewayID,
		}).WithError(err).Error("get gateway cache error")
		// we don't return the error as we can still fall-back onto db retrieval
	}

	gw, err = GetGateway(db, gatewayID)
	if err != nil {
		return gw, errors.Wrap(err, "get gateway error")
	}

	err = CreateGatewayCache(p, gw)
	if err != nil {
		log.WithFields(log.Fields{
			"gateway_id": gatewayID,
		}).WithError(err).Error("create gateway cache error")
	}

	return gw, nil
}
733508
func GetHostStatus(api libmachine.API) (string, error) {
	exists, err := api.Exists(cfg.GetMachineName())
	if err != nil {
		return "", errors.Wrapf(err, "%s exists", cfg.GetMachineName())
	}
	if !exists {
		return state.None.String(), nil
	}

	host, err := api.Load(cfg.GetMachineName())
	if err != nil {
		return "", errors.Wrapf(err, "load")
	}

	s, err := host.Driver.GetState()
	if err != nil {
		return "", errors.Wrap(err, "state")
	}
	return s.String(), nil
}
851220
func (u *UpdateCheckRunOptions) GetStatus() string {
	if u == nil || u.Status == nil {
		return ""
	}
	return *u.Status
}
579446
func (lic *LocalImageCache) GetCache(imgID string, config *containertypes.Config) (string, error) {
	return getImageIDAndError(getLocalCachedImage(lic.store, image.ID(imgID), config))
}
469880
func (r *vstResponse) CheckStatus(validStatusCodes ...int) error {
	for _, x := range validStatusCodes {
		if x == r.ResponseCode {
			// Found valid status code
			return nil
		}
	}
	// Invalid status code, try to parse arango error response.
	var aerr driver.ArangoError
	if err := r.ParseBody("", &aerr); err == nil {
		// Found correct arango error.
		return aerr
	}

	// We do not have a valid error code, so we can only create one based on the HTTP status code.
	return driver.ArangoError{
		HasError:     true,
		Code:         r.ResponseCode,
		ErrorMessage: fmt.Sprintf("Unexpected status code %d", r.ResponseCode),
	}
}
345102
func (r Account_Agreement) GetStatus() (resp datatypes.Account_Agreement_Status, err error) {
	err = r.Session.DoRequest("SoftLayer_Account_Agreement", "getStatus", nil, &r.Options, &resp)
	return
}
915602
func (c *CommitFile) GetStatus() string {
	if c == nil || c.Status == nil {
		return ""
	}
	return *c.Status
}
1315381
func getCachedCerts(c context.Context) (*signing.PublicCertificates, error) {
	v, err := certCache.Fetch(c, func(interface{}) (interface{}, time.Duration, error) {
		aeCerts, err := info.PublicCertificates(c)
		if err != nil {
			return nil, 0, err
		}
		certs := make([]signing.Certificate, len(aeCerts))
		for i, ac := range aeCerts {
			certs[i] = signing.Certificate{
				KeyName:            ac.KeyName,
				X509CertificatePEM: string(ac.Data),
			}
		}
		inf, err := getCachedInfo(c)
		if err != nil {
			return nil, 0, err
		}
		return &signing.PublicCertificates{
			AppID:              inf.AppID,
			ServiceAccountName: inf.ServiceAccountName,
			Certificates:       certs,
			Timestamp:          signing.JSONTime(clock.Now(c)),
		}, time.Hour, nil
	})
	if err != nil {
		return nil, err
	}
	return v.(*signing.PublicCertificates), nil
}
1145725
func (r Survey) GetStatus() (resp datatypes.Survey_Status, err error) {
	err = r.Session.DoRequest("SoftLayer_Survey", "getStatus", nil, &r.Options, &resp)
	return
}