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

Side by Side Diff: appengine_module/gae_ts_mon/metrics.py

Issue 1260293009: make version of ts_mon compatible with appengine (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: clean up code Created 5 years, 4 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 unified diff | Download patch
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
agable 2015/08/10 23:04:38 I realize the imports are different, but: See if t
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 """Classes representing individual metrics that can be sent.""" 5 """Classes representing individual metrics that can be sent."""
6 6
7 7
8 import copy 8 import copy
9 import threading 9 import threading
10 import time 10 import time
11 11
12 from monacq.proto import metrics_pb2 12 import interface
13 from gae import distribution
14 from gae import errors
13 15
14 from infra_libs.ts_mon import distribution 16 from proto import metrics_pb2
15 from infra_libs.ts_mon import errors
16 from infra_libs.ts_mon import interface
17 17
18 18
19 MICROSECONDS_PER_SECOND = 1000000 19 MICROSECONDS_PER_SECOND = 1000000
20 20
21 21
22 class Metric(object): 22 class Metric(object):
23 """Abstract base class for a metric. 23 """Abstract base class for a metric.
24 24
25 A Metric is an attribute that may be monitored across many targets. Examples 25 A Metric is an attribute that may be monitored across many targets. Examples
26 include disk usage or the number of requests a server has received. A single 26 include disk usage or the number of requests a server has received. A single
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 425
426 def __init__( 426 def __init__(
427 self, name, bucketer=None, target=None, fields=None, time_fn=time.time): 427 self, name, bucketer=None, target=None, fields=None, time_fn=time.time):
428 super(NonCumulativeDistributionMetric, self).__init__( 428 super(NonCumulativeDistributionMetric, self).__init__(
429 name, 429 name,
430 is_cumulative=False, 430 is_cumulative=False,
431 bucketer=bucketer, 431 bucketer=bucketer,
432 target=target, 432 target=target,
433 fields=fields, 433 fields=fields,
434 time_fn=time_fn) 434 time_fn=time_fn)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698