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

Side by Side Diff: appengine/third_party/gae_ts_mon/config.py

Issue 2573343002: Roll infra_libs and its dependencies to 066f135 (Closed)
Patch Set: Created 4 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
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 copy 5 import copy
6 import datetime 6 import datetime
7 import functools 7 import functools
8 import logging 8 import logging
9 import os 9 import os
10 import sys 10 import sys
(...skipping 21 matching lines...) Expand all
32 from infra_libs.ts_mon.common import metric_store 32 from infra_libs.ts_mon.common import metric_store
33 from infra_libs.ts_mon.common import monitors 33 from infra_libs.ts_mon.common import monitors
34 from infra_libs.ts_mon.common import standard_metrics 34 from infra_libs.ts_mon.common import standard_metrics
35 from infra_libs.ts_mon.common import targets 35 from infra_libs.ts_mon.common import targets
36 36
37 37
38 def _reset_cumulative_metrics(): 38 def _reset_cumulative_metrics():
39 """Clear the state when an instance loses its task_num assignment.""" 39 """Clear the state when an instance loses its task_num assignment."""
40 logging.warning('Instance %s got purged from Datastore, but is still alive. ' 40 logging.warning('Instance %s got purged from Datastore, but is still alive. '
41 'Clearing cumulative metrics.', shared.instance_key_id()) 41 'Clearing cumulative metrics.', shared.instance_key_id())
42 for _target, metric, start_time, _fields in interface.state.store.get_all(): 42 for _, metric, _, _, _ in interface.state.store.get_all():
43 if metric.is_cumulative(): 43 if metric.is_cumulative():
44 metric.reset() 44 metric.reset()
45 45
46 46
47 _flush_metrics_lock = threading.Lock() 47 _flush_metrics_lock = threading.Lock()
48 48
49 49
50 def need_to_flush_metrics(time_now): 50 def need_to_flush_metrics(time_now):
51 """Check if metrics need flushing, and update the timestamp of last flush. 51 """Check if metrics need flushing, and update the timestamp of last flush.
52 52
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 duration_secs * 1000, 349 duration_secs * 1000,
350 request_size=request_size, 350 request_size=request_size,
351 response_size=response_size, 351 response_size=response_size,
352 user_agent=request.META.get('HTTP_USER_AGENT', None)) 352 user_agent=request.META.get('HTTP_USER_AGENT', None))
353 return response 353 return response
354 354
355 355
356 def reset_for_unittest(disable=False): 356 def reset_for_unittest(disable=False):
357 shared.reset_for_unittest() 357 shared.reset_for_unittest()
358 interface.reset_for_unittest(disable=disable) 358 interface.reset_for_unittest(disable=disable)
OLDNEW
« no previous file with comments | « appengine/third_party/gae_ts_mon/README.swarming ('k') | client/third_party/infra_libs/README.swarming » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698