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

Unified Diff: milo/appengine/buildbot/pubsub.go

Issue 2418063002: Milo: Add ts_mon metrics for master json datastore success (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/appengine/buildbot/pubsub.go
diff --git a/milo/appengine/buildbot/pubsub.go b/milo/appengine/buildbot/pubsub.go
index 81dd9bfbc5c2b51510ef89f411fedaf17b2a2868..66ecd8caf78f956351854cd0fd9ca93016723538 100644
--- a/milo/appengine/buildbot/pubsub.go
+++ b/milo/appengine/buildbot/pubsub.go
@@ -42,6 +42,15 @@ var (
field.Bool("finished"),
// Status can be one of 3 options. "New", "Replaced", "Rejected".
field.String("status"))
+
+ masterCounter = metric.NewCounter(
+ "luci/milo/buildbot_pubsub/masters",
+ "The number of buildbot master jsons received by Milo from PubSub",
+ nil,
+ field.Bool("internal"),
+ field.String("master"),
+ // Status can be one of 2 options. "Success", "Failure".
dsansome 2016/10/16 23:45:36 Convention is for these field values to be lower-c
hinoka 2016/10/17 21:35:13 Done.
+ field.String("status"))
)
type pubSubMessage struct {
@@ -294,10 +303,12 @@ func PubSubHandler(ctx *router.Context) {
if err != nil {
logging.WithError(err).Errorf(
c, "Could not save master in datastore %s", err)
+ masterCounter.Add(c, 1, internal, master.Name, "Failure")
dsansome 2016/10/16 23:45:36 Does master.Name have a "master." prefix? If not
hinoka 2016/10/17 21:35:13 It does not, I assume it'd be better to normalize
// This is transient, we do want PubSub to retry.
h.WriteHeader(500)
return
}
+ masterCounter.Add(c, 1, internal, master.Name, "Success")
}
h.WriteHeader(200)
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698