Chromium Code Reviews| 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) |
| } |