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

Unified Diff: go/httputils/http.go

Issue 1722163002: Metrics2: Store a registry of Counters (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Address comments 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
« no previous file with comments | « go/buildbot/local_db.go ('k') | go/metrics2/counter.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/httputils/http.go
diff --git a/go/httputils/http.go b/go/httputils/http.go
index 6bd691d2dd93f37a2b69e020298084bfbd3f2fa1..865a84e2af9b10382810b7791a781908de39b62e 100644
--- a/go/httputils/http.go
+++ b/go/httputils/http.go
@@ -16,8 +16,8 @@ import (
// google-http-java-client.
"github.com/cenkalti/backoff"
"github.com/fiorix/go-web/autogzip"
- "github.com/rcrowley/go-metrics"
"github.com/skia-dev/glog"
+ "go.skia.org/infra/go/metrics2"
"go.skia.org/infra/go/timer"
"go.skia.org/infra/go/util"
)
@@ -184,7 +184,7 @@ type responseProxy struct {
func (rp *responseProxy) WriteHeader(code int) {
if !rp.wroteHeader {
glog.Infof("Response Code: %d", code)
- metrics.GetOrRegisterCounter(fmt.Sprintf("http.statuscode.%d", code), metrics.DefaultRegistry).Inc(1)
+ metrics2.GetCounter("http.response", map[string]string{"statuscode": strconv.Itoa(code)}).Inc(1)
rp.ResponseWriter.WriteHeader(code)
rp.wroteHeader = true
}
« no previous file with comments | « go/buildbot/local_db.go ('k') | go/metrics2/counter.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698