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

Side by Side Diff: perf/go/alerting/alerting.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 unified diff | Download patch
« no previous file with comments | « go/trace/service/impl.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 package alerting 1 package alerting
2 2
3 import ( 3 import (
4 "database/sql" 4 "database/sql"
5 "encoding/json" 5 "encoding/json"
6 "fmt" 6 "fmt"
7 "math" 7 "math"
8 "time" 8 "time"
9 9
10 "github.com/skia-dev/glog" 10 "github.com/skia-dev/glog"
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 count++ 325 count++
326 } 326 }
327 } 327 }
328 glog.Infof("Updated new cluster count: %d", count) 328 glog.Infof("Updated new cluster count: %d", count)
329 newClustersGauge.Update(int64(count)) 329 newClustersGauge.Update(int64(count))
330 } 330 }
331 331
332 // Start kicks off a go routine the periodically refreshes the current alerting clusters. 332 // Start kicks off a go routine the periodically refreshes the current alerting clusters.
333 func Start(tb tracedb.MasterTileBuilder) { 333 func Start(tb tracedb.MasterTileBuilder) {
334 newClustersGauge = metrics2.GetInt64Metric("perf.clustering.untriaged", nil) 334 newClustersGauge = metrics2.GetInt64Metric("perf.clustering.untriaged", nil)
335 » runsCounter = metrics2.NewCounter("perf.clustering.runs", nil) 335 » runsCounter = metrics2.GetCounter("perf.clustering.runs", nil)
336 clusteringLatency = metrics2.NewTimer("perf.clustering.latency", nil) 336 clusteringLatency = metrics2.NewTimer("perf.clustering.latency", nil)
337 tileBuilder = tb 337 tileBuilder = tb
338 client, err := auth.NewDefaultJWTServiceAccountClient("https://www.googl eapis.com/auth/userinfo.email") 338 client, err := auth.NewDefaultJWTServiceAccountClient("https://www.googl eapis.com/auth/userinfo.email")
339 if err != nil { 339 if err != nil {
340 glog.Errorf("Not updating bugs, not able to construct an authent icated client: %s", err) 340 glog.Errorf("Not updating bugs, not able to construct an authent icated client: %s", err)
341 } 341 }
342 var issueTracker issues.IssueTracker = nil 342 var issueTracker issues.IssueTracker = nil
343 if client != nil { 343 if client != nil {
344 issueTracker = issues.NewMonorailIssueTracker(client) 344 issueTracker = issues.NewMonorailIssueTracker(client)
345 } 345 }
346 346
347 go func() { 347 go func() {
348 for _ = range time.Tick(config.RECLUSTER_DURATION) { 348 for _ = range time.Tick(config.RECLUSTER_DURATION) {
349 singleStep(issueTracker) 349 singleStep(issueTracker)
350 } 350 }
351 }() 351 }()
352 } 352 }
OLDNEW
« no previous file with comments | « go/trace/service/impl.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698