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

Unified Diff: infra/services/sysmon/system_metrics.py

Issue 2111473003: Issue 623854: Support unit annotations in ts_mon metrics (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Split off go changes to a separate CL: https://codereview.chromium.org/2125943003 Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « infra/services/sysmon/puppet_metrics.py ('k') | infra_libs/ts_mon/__init__.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: infra/services/sysmon/system_metrics.py
diff --git a/infra/services/sysmon/system_metrics.py b/infra/services/sysmon/system_metrics.py
index 9b2e4382f4275a8a3ba63b4ee85dc696825a39a0..dc2a9a18852d1a02434a9a460ce21c59174ff1e4 100644
--- a/infra/services/sysmon/system_metrics.py
+++ b/infra/services/sysmon/system_metrics.py
@@ -19,9 +19,11 @@ cpu_time = ts_mon.FloatMetric('dev/cpu/time',
' in different states.')
disk_free = ts_mon.GaugeMetric('dev/disk/free',
- description='Available bytes on disk partition.')
+ description='Available bytes on disk partition.',
+ units=ts_mon.MetricsDataUnits.BYTES)
disk_total = ts_mon.GaugeMetric('dev/disk/total',
- description='Total bytes on disk partition.')
+ description='Total bytes on disk partition.',
+ units=ts_mon.MetricsDataUnits.BYTES)
# inode counts are only available on Unix.
if os.name == 'posix': # pragma: no cover
@@ -35,17 +37,21 @@ if os.name == 'posix': # pragma: no cover
mem_free = ts_mon.GaugeMetric('dev/mem/free',
description='Amount of memory available to a '
'process (in Bytes). Buffers are considered '
- 'free memory.')
+ 'free memory.',
+ units=ts_mon.MetricsDataUnits.BYTES)
mem_total = ts_mon.GaugeMetric('dev/mem/total',
- description='Total physical memory in Bytes.')
+ description='Total physical memory in Bytes.',
+ units=ts_mon.MetricsDataUnits.BYTES)
START_TIME = psutil.boot_time()
net_up = ts_mon.CounterMetric('dev/net/bytes/up', start_time=START_TIME,
- description='Number of bytes sent on interface.')
+ description='Number of bytes sent on interface.',
+ units=ts_mon.MetricsDataUnits.BYTES)
net_down = ts_mon.CounterMetric('dev/net/bytes/down', start_time=START_TIME,
description='Number of Bytes received on '
- 'interface.')
+ 'interface.',
+ units=ts_mon.MetricsDataUnits.BYTES)
net_err_up = ts_mon.CounterMetric('dev/net/err/up', start_time=START_TIME,
description='Total number of errors when '
'sending (per interface).')
@@ -60,13 +66,16 @@ net_drop_down = ts_mon.CounterMetric('dev/net/drop/down', start_time=START_TIME,
'packets that have been dropped.')
disk_read = ts_mon.CounterMetric('dev/disk/read', start_time=START_TIME,
- description='Number of Bytes read on disk.')
+ description='Number of Bytes read on disk.',
+ units=ts_mon.MetricsDataUnits.BYTES)
disk_write = ts_mon.CounterMetric('dev/disk/write', start_time=START_TIME,
description='Number of Bytes written on '
- 'disk.')
+ 'disk.',
+ units=ts_mon.MetricsDataUnits.BYTES)
uptime = ts_mon.GaugeMetric('dev/uptime',
- description='Machine uptime, in seconds.')
+ description='Machine uptime, in seconds.',
+ units=ts_mon.MetricsDataUnits.SECONDS)
proc_count = ts_mon.GaugeMetric('dev/proc/count',
description='Number of processes currently '
« no previous file with comments | « infra/services/sysmon/puppet_metrics.py ('k') | infra_libs/ts_mon/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698