MCPcopy Create free account
hub / github.com/facebook/time / SetCounter

Method SetCounter

fbclock/stats/stats.go:54–58  ·  view source on GitHub ↗

SetCounter will set a counter to the provided value.

(key string, val int64)

Source from the content-addressed store, hash-verified

52}
53
54// SetCounter will set a counter to the provided value.
55func (s Stats) SetCounter(key string, val int64) {
56 mux.Lock()
57 s.counters[key] = val
58 mux.Unlock()
59}
60
61// Get returns an map of counters

Callers 7

TestSetCounterFunction · 0.95
TestSetCounterOverwriteFunction · 0.95
TestGetReturnsCopyFunction · 0.95
TestGetMultipleKeysFunction · 0.95
TestCopyFunction · 0.95
TestResetFunction · 0.95
TestConcurrentAccessFunction · 0.95

Calls 1

UnlockMethod · 0.65

Tested by 7

TestSetCounterFunction · 0.76
TestSetCounterOverwriteFunction · 0.76
TestGetReturnsCopyFunction · 0.76
TestGetMultipleKeysFunction · 0.76
TestCopyFunction · 0.76
TestResetFunction · 0.76
TestConcurrentAccessFunction · 0.76