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

Side by Side Diff: infra/services/devicemon/device_metrics.py

Issue 1993443002: Delete devicemon; moving to sysmon. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « infra/services/devicemon/__main__.py ('k') | infra/services/devicemon/test/__init__.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # -*- coding: utf-8 -*-
2 # Copyright 2016 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 from infra_libs import ts_mon
7
8
9 cpu_temp_metric = ts_mon.FloatMetric('dev/cpu/temperature',
10 description=u"Temperature (°C) of the device's CPU")
11 battery_temp_metric = ts_mon.FloatMetric('dev/battery/temperature',
12 description=u"Temperature (°C) of the device's battery")
13 battery_charge_metric = ts_mon.FloatMetric('dev/battery/charge',
14 description="Charge (%) of the device's battery")
15 device_status_metric = ts_mon.StringMetric('dev/status',
16 description='Status of the device')
17
18
19 def set_cpu_temp(_device, metric_fields):
20 cpu_temp = 0 # todo: get cpu temp
21 cpu_temp_metric.set(cpu_temp, metric_fields)
22
23
24 def set_battery_temp(_device, metric_fields):
25 battery_temp = 0 # todo: get battery temp
26 battery_temp_metric.set(battery_temp, metric_fields)
27
28
29 def set_battery_charge(_device, metric_fields):
30 battery_charge = 0 # todo: get battery charge
31 battery_charge_metric.set(battery_charge, metric_fields)
32
33
34 def set_device_status(_device, metric_fields, status='unknown'):
35 device_status_metric.set(status, metric_fields)
OLDNEW
« no previous file with comments | « infra/services/devicemon/__main__.py ('k') | infra/services/devicemon/test/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698