Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Unified Diff: go/metrics2/counter.go

Issue 1682363003: Migrate fuzzer to use shiny new metrics2 package (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« fuzzer/sys/fuzzer-be.service ('K') | « fuzzer/sys/fuzzer-fe.service ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/metrics2/counter.go
diff --git a/go/metrics2/counter.go b/go/metrics2/counter.go
index 15750a505c317504e447f778a2d0be1059cf7afa..cd645de4c59185912983880631d1f6b7324a905b 100644
--- a/go/metrics2/counter.go
+++ b/go/metrics2/counter.go
@@ -51,3 +51,10 @@ func (c *Counter) Reset() {
defer c.mtx.Unlock()
c.m.Update(0)
}
+
+// Count returns the current value in the counter.
+func (c *Counter) Count() int64 {
borenet 2016/02/10 15:32:32 For consistency, let's just call this Get()
kjlubick 2016/02/10 16:14:29 Done.
+ c.mtx.Lock()
+ defer c.mtx.Unlock()
+ return c.m.Get()
+}
« fuzzer/sys/fuzzer-be.service ('K') | « fuzzer/sys/fuzzer-fe.service ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698