| OLD | NEW |
| (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) | |
| OLD | NEW |