Add data structure description to Sensors() object

This commit is contained in:
2Shirt 2023-10-07 16:36:17 -07:00
parent 484f13dc29
commit d7067af522
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -37,7 +37,42 @@ class ThermalLimitReachedError(RuntimeError):
# Classes
class Sensors():
"""Class for holding sensor specific data."""
"""Class for holding sensor specific data.
# Sensor data structure
#
# Section # CPUTemps / Other
# Adapters # coretemp / acpi / nvme / etc
# Sources # Core 1 / SODIMM / Sensor X / etc
# Label # temp1_input / etc (i.e. lm_sensor label)
# Max # 99.0
# X # 55.0 (where X is Idle/Current/Sysbench/etc)
# Temps # [39.0, 38.0, 40.0, 39.0, 38.0, ...]
#
# e.g.
# { 'CPUTemps': { 'coretemp-isa-0000': { 'Core 0': { 'Average': 44.5,
# 'Current': 44.0,
# 'Idle': 44.5,
# 'Label': 'temp2_input',
# 'Max': 45.0,
# 'Temps': [ 45.0,
# 45.0,
# ...,
# 42.0]}}}}
#
# Sensor history data structure
# [ ('Name of "run"', sensor_data_structure_described_above), ]
#
# e.g.
# [
# ( 'Idle',
# { 'CPUTemps': { 'coretemp-isa-0000': { 'Core 0': { 'Max': 45.0, ..., }}}}
# ),
# ( 'Sysbench',
# { 'CPUTemps': { 'coretemp-isa-0000': { 'Core 0': { 'Max': 85.0, ..., }}}}
# ),
# ]
"""
def __init__(self):
self.background_thread: Thread | None = None
self.data: dict[Any, Any] = get_sensor_data()