mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-21 06:20:31 +00:00
allow more accurate reporting of memcache hit ratio
A lot of time could pass between recording the request count and hit count pertaining to a particular report fetching batch, which skewed calculations cache hit ratios. Fix that by defering the request count recording to the end, which is when we record the hit count.
This commit is contained in:
@@ -150,7 +150,7 @@ func memcacheStatusCode(err error) string {
|
||||
|
||||
// FetchReports gets reports from memcache.
|
||||
func (c *MemcacheClient) FetchReports(keys []string) (map[string]report.Report, []string, error) {
|
||||
memcacheRequests.Add(float64(len(keys)))
|
||||
defer memcacheRequests.Add(float64(len(keys)))
|
||||
var found map[string]*memcache.Item
|
||||
err := instrument.TimeRequestHistogramStatus("Get", memcacheRequestDuration, memcacheStatusCode, func() error {
|
||||
var err error
|
||||
|
||||
Reference in New Issue
Block a user