forked from luci/luci-py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmetrics.py
50 lines (36 loc) · 1.27 KB
/
metrics.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Copyright 2015 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Metrics to track with ts_mon and event_mon."""
import gae_ts_mon
lease_requests_deduped = gae_ts_mon.CounterMetric(
'machine_provider/lease_requests/deduped',
'Number of lease requests deduplicated.',
None,
)
lease_requests_expired = gae_ts_mon.CounterMetric(
'machine_provider/lease_requests/expired',
'Number of lease requests expired.',
None,
)
lease_requests_fulfilled = gae_ts_mon.CounterMetric(
'machine_provider/lease_requests/fulfilled',
'Number of lease requests fulfilled.',
None,
)
lease_requests_fulfilled_time = gae_ts_mon.CumulativeDistributionMetric(
'machine_provider/lease_requests/fulfilled/time',
'Time taken to fulfill a lease request.',
None,
bucketer=gae_ts_mon.GeometricBucketer(growth_factor=10**0.04),
)
lease_requests_received = gae_ts_mon.CounterMetric(
'machine_provider/lease_requests/received',
'Number of lease requests received.',
None,
)
pubsub_messages_sent = gae_ts_mon.CounterMetric(
'machine_provider/pubsub_messages/sent',
'Number of Pub/Sub messages sent.',
[gae_ts_mon.StringField('target')],
)