argotronic / argus_data_api

Data API to access sensor data provided by a running instance of Argus Monitor
14 stars 6 forks source link

Clarification of DataIndex and SensorIndex #5

Closed iratemike closed 1 year ago

iratemike commented 1 year ago

Hello,

Thank you for the great API!

I'm seeking a bit of clarification around DataIndex and SensorIndex.

Given the below example output:

label sensor_type data_index sensor_index value unit_string
CPU Temp 1 0 0 49 ░C
CPU Socket Temp 1 0 1 30 ░C
Motherboard Temp 1 0 2 33 ░C
Temp. 1 1 0 3 27.7 ░C
Memory Module 0 1 0 4 30.5 ░C
Memory Module 1 1 0 5 29.75 ░C
Maximum (CPU| GPU) 2 0 0 38.1667 ░C
Mean (CPU| GPU) 2 1 0 32.0833 ░C
Average(CPU| 10s) 2 2 0 35.3992 ░C
Average(GPU| 10s) 2 3 0 26 ░C
Average(Max(CPU| GPU)| 15s) 2 4 0 34.7978 ░C
Average(Mean(CPU| GPU)| 15s) 2 5 0 30.3989 ░C
Maximum (CPU| GPU Hot Spot) 2 6 0 38.1667 ░C
CPU_FAN 3 0 0 1057 rpm
CASE_FAN 3 0 1 853 rpm
Pump 3 0 2 2000 rpm
CPU_FAN 4 0 0 56 %
CASE_FAN 4 0 1 64 %
Pump 4 0 2 66 %
Intel(R) I211 G 5 0 0 13086 Bytes/sec (up)
Intel(R) I211 G 5 1 0 1609 Bytes/sec (down)
Core 0 6 0 0 38.1667 ░C
Core 1 6 1 0 38.1667 ░C
Core 2 6 2 0 38.1667 ░C
Core 3 6 3 0 38.1667 ░C
Core 4 6 4 0 37.6625 ░C
Core 5 6 5 0 38.1667 ░C
Core 6 6 6 0 38.1667 ░C
Core 7 6 7 0 38.1667 ░C
Core 8 6 8 0 38.1667 ░C
Core 9 6 9 0 38.1667 ░C
Core 10 6 10 0 38.1667 ░C
Core 11 6 11 0 38.1667 ░C
Core CPU CCD1 7 0 0 34.4667 ░C
Core CPU CCD2 7 1 0 34.3083 ░C

For some sensor types all sensor indexes are 0, while the data index follows an incrementing zero based index. An example in the above output is sensor type 6.

As per argus_monitor_data_api.h:

std::uint32_t             DataIndex;      // for sensor which can provide multiple different readings, Core ID on multi core systems
std::uint32_t             SensorIndex;    // for Sensors with multiple instances (e.g. CPU, GPU) CPU/GPU index

I'm wondering if you have any guidance around which sensors will have an incrementing sensor index.

Another question I have is how stable these indexes are. After a restart they seem to remain the same, but I'm wondering if they might reorder in day to day use depending on how they're enumerated by Argus Monitor.

Thanks again!

argotronic commented 1 year ago

Hi,

I started with those two independent index values because I wanted to distinguish between 'independent' sensors (like temperature sensors on the mainboard or fans) and multiple readings from one 'sensor' (like the CPU with independent cores).

The only instance where both indices are actually needed are either Multi-CPU systems where the sensor_index is the CPU package and the data_index is the core index or systems with more than one GPU, where the sensor_index refers to the GPU the data is read from.

The stability of index values is not guaranteed, but they are filled in the same order all the time. So in practice, they should be identical over multiple runs. But if you for instance add a new synthetic temperature or plug in a new HDD while Argus is running, these values would then be added and could shift index values of sensors after the one that got inserted -- even from one update cycle to the next (with no restart of Argus).

iratemike commented 1 year ago

Thank you very much for the clarification.