From 6308e62bbb91a979481e6650bd82cae49a7058c2 Mon Sep 17 00:00:00 2001 From: Tommy PAGEARD Date: Wed, 8 Jul 2020 19:01:58 +0200 Subject: [PATCH] style(metrics): rename get from peers stats --- groupcache.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/groupcache.go b/groupcache.go index 3238876..ddfe8da 100644 --- a/groupcache.go +++ b/groupcache.go @@ -195,16 +195,16 @@ type flightGroup interface { // Stats are per-group statistics. type Stats struct { - Gets AtomicInt // any Get request, including from peers - CacheHits AtomicInt // either cache was good - GetFromPeersSlowestDuration AtomicInt // slowest duration to request value from peers - PeerLoads AtomicInt // either remote load or remote cache hit (not an error) - PeerErrors AtomicInt - Loads AtomicInt // (gets - cacheHits) - LoadsDeduped AtomicInt // after singleflight - LocalLoads AtomicInt // total good local loads - LocalLoadErrs AtomicInt // total bad local loads - ServerRequests AtomicInt // gets that came over the network from peers + Gets AtomicInt // any Get request, including from peers + CacheHits AtomicInt // either cache was good + GetFromPeersLatencyLower AtomicInt // slowest duration to request value from peers + PeerLoads AtomicInt // either remote load or remote cache hit (not an error) + PeerErrors AtomicInt + Loads AtomicInt // (gets - cacheHits) + LoadsDeduped AtomicInt // after singleflight + LocalLoads AtomicInt // total good local loads + LocalLoadErrs AtomicInt // total bad local loads + ServerRequests AtomicInt // gets that came over the network from peers } // Name returns the name of the group. @@ -339,8 +339,8 @@ func (g *Group) load(ctx context.Context, key string, dest Sink) (value ByteView duration := int64(time.Since(start)) / int64(time.Millisecond) // metrics only store the slowest duration - if g.Stats.GetFromPeersSlowestDuration.Get() < duration { - g.Stats.GetFromPeersSlowestDuration.Store(duration) + if g.Stats.GetFromPeersLatencyLower.Get() < duration { + g.Stats.GetFromPeersLatencyLower.Store(duration) } if err == nil {