MCPcopy
hub / github.com/dropbox/godropbox / Stat

Method Stat

memcache/sharded_client.go:454–478  ·  view source on GitHub ↗

See Client interface for documentation.

(statsKey string)

Source from the content-addressed store, hash-verified

452
453// See Client interface for documentation.
454func (c *ShardedClient) Stat(statsKey string) StatResponse {
455 statEntries := make(map[int](map[string]string))
456
457 var err error
458 for shard, conn := range c.manager.GetAllShards() {
459 response := c.statHelper(shard, conn, statsKey)
460 if response.Error() != nil {
461 if err == nil {
462 err = response.Error()
463 } else {
464 err = errors.Wrap(response.Error(), err.Error())
465 }
466 }
467
468 for shardId, entries := range response.Entries() {
469 statEntries[shardId] = entries
470 }
471 }
472
473 if err != nil {
474 return NewStatErrorResponse(err, statEntries)
475 }
476
477 return NewStatResponse(StatusNoError, statEntries)
478}
479
480func (c *ShardedClient) versionHelper(
481 shard int,

Callers

nothing calls this directly

Calls 7

statHelperMethod · 0.95
WrapFunction · 0.92
NewStatErrorResponseFunction · 0.85
NewStatResponseFunction · 0.85
GetAllShardsMethod · 0.65
ErrorMethod · 0.65
EntriesMethod · 0.65

Tested by

no test coverage detected