OLD | NEW |
1 # Copyright 2016 The LUCI Authors. All rights reserved. | 1 # Copyright 2016 The LUCI Authors. All rights reserved. |
2 # Use of this source code is governed by the Apache v2.0 license that can be | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
3 # found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
4 | 4 |
5 """Timeseries metrics.""" | 5 """Timeseries metrics.""" |
6 | 6 |
7 import itertools | 7 import itertools |
8 | 8 |
9 from google.appengine.ext import ndb | 9 from google.appengine.ext import ndb |
10 | 10 |
11 from components import utils | 11 from components import utils |
12 import gae_ts_mon | 12 import gae_ts_mon |
13 | 13 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 def _set_global_metrics(now=None): | 177 def _set_global_metrics(now=None): |
178 if now is None: | 178 if now is None: |
179 now = utils.utcnow() | 179 now = utils.utcnow() |
180 _set_global_metrics_async(now).get_result() | 180 _set_global_metrics_async(now).get_result() |
181 | 181 |
182 | 182 |
183 def initialize(): | 183 def initialize(): |
184 gae_ts_mon.register_global_metrics( | 184 gae_ts_mon.register_global_metrics( |
185 [jobs_status, executors_pool, executors_status]) | 185 [jobs_status, executors_pool, executors_status]) |
186 gae_ts_mon.register_global_metrics_callback('callback', _set_global_metrics) | 186 gae_ts_mon.register_global_metrics_callback('callback', _set_global_metrics) |
OLD | NEW |