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

Side by Side Diff: appengine/cr-buildbucket/test/metrics_test.py

Issue 1532713002: buildbucket: add monitoring using ts_mon (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: duration Created 5 years 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 | « appengine/cr-buildbucket/service.py ('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 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import datetime 5 import datetime
6 6
7 from google.appengine.ext import ndb 7 from google.appengine.ext import ndb
8 import mock 8 import mock
9 9
10 from components import metrics as metrics_component 10 from components import metrics as metrics_component
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 project_config_pb2.Bucket(name='x') 85 project_config_pb2.Bucket(name='x')
86 ]) 86 ])
87 self.mock(metrics, 'send_build_status_metric', mock.Mock()) 87 self.mock(metrics, 'send_build_status_metric', mock.Mock())
88 88
89 metrics.send_all_metrics() 89 metrics.send_all_metrics()
90 90
91 metrics.send_build_status_metric.assert_any_call( 91 metrics.send_build_status_metric.assert_any_call(
92 buf, 'x', metrics.METRIC_PENDING_BUILDS, model.BuildStatus.SCHEDULED) 92 buf, 'x', metrics.METRIC_PENDING_BUILDS, model.BuildStatus.SCHEDULED)
93 metrics.send_build_status_metric.assert_any_call( 93 metrics.send_build_status_metric.assert_any_call(
94 buf, 'x', metrics.METRIC_RUNNING_BUILDS, model.BuildStatus.STARTED) 94 buf, 'x', metrics.METRIC_RUNNING_BUILDS, model.BuildStatus.STARTED)
95
96 def test_fields_for(self):
97 self.assertEqual(
98 metrics.fields_for(
99 model.Build(
100 bucket='master.x',
101 tags=['builder:release', 'user_agent:cq', 'something:else']),
102 result='SUCCESS'),
103 {
104 'bucket': 'master.x',
105 'builder': 'release',
106 'user_agent': 'cq',
107 'result': 'SUCCESS',
108 }
109 )
OLDNEW
« no previous file with comments | « appengine/cr-buildbucket/service.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698