description='Number of possible inodes on ' 'disk partition (unix only)') _mem_free_metric = metrics.GaugeMetric( 'dev/mem/free', description='Amount of memory available to a ' 'process (in Bytes). Buffers are considered ' 'free memory.') _mem_total_metric = metrics.GaugeMetric( 'dev/mem/total', description='Total physical memory in Bytes.') _BOOT_TIME = psutil.boot_time() _disk_read_metric = metrics.CounterMetric( 'dev/disk/read', start_time=_BOOT_TIME, description='Number of Bytes read on disk.') _disk_write_metric = metrics.CounterMetric( 'dev/disk/write', start_time=_BOOT_TIME, description='Number of Bytes written on disk.') _uptime_metric = metrics.GaugeMetric('dev/uptime', description='Machine uptime, in seconds.') _load_average_metric = metrics.FloatMetric( 'dev/proc/load_average', description='Number of processes currently ' 'in the system run queue.') # ts_mon pipeline uses backend clocks when assigning timestamps to metric
import collections import socket import psutil # pylint: disable=import-error from infra_libs import ts_mon from chromite.lib import cros_logging as logging from chromite.lib import metrics logger = logging.getLogger(__name__) _BOOT_TIME = psutil.boot_time() _net_bytes_metric = metrics.CounterMetric( 'dev/net/bytes', start_time=_BOOT_TIME, description='Number of bytes up/down on interface.') _net_packets_metric = metrics.CounterMetric( 'dev/net/packets', start_time=_BOOT_TIME, description='Number of packets up/down on interface.') _net_errors_metric = metrics.CounterMetric( 'dev/net/errors', start_time=_BOOT_TIME, description='Total number of errors up/down on interface.') _net_dropped_metric = metrics.CounterMetric( 'dev/net/dropped', start_time=_BOOT_TIME, description='Total number of dropped packages up/down on interface.') _net_if_isup_metric = metrics.BooleanMetric(