robotika / osgar

Open Source Garden (Autonomous) Robot
MIT License
13 stars 12 forks source link

Logging CPU load, temperature, ram #828

Closed tajgr closed 3 years ago

tajgr commented 3 years ago

Records system information like CPU and RAM utilization or device temperatures. TODO log dmesg

m3d commented 3 years ago

Is this output expected?

(osgar) md@md-ThinkPad-P50:~/git/osgar$ python -m osgar.logger /home/md/git/osgar/test_system_monitor-210705_065142.log --stream app.cpu
0:00:00.018478 1 [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
0:00:01.088317 1 [0.9, 2.8, 0.0, 0.9, 7.3, 3.7, 2.8, 0.0]
0:00:02.165962 1 [1.9, 1.9, 0.0, 0.9, 0.9, 3.7, 0.0, 2.8]
0:00:03.251982 1 [2.8, 3.7, 0.0, 1.8, 0.0, 1.8, 3.6, 1.9]
0:00:04.340923 1 [2.7, 0.9, 0.0, 0.0, 0.9, 1.8, 2.7, 3.6]
0:00:05.520097 1 [1.7, 1.7, 0.9, 1.7, 0.0, 0.0, 0.0, 5.0]
0:00:06.609389 1 [1.9, 4.5, 1.9, 1.8, 1.8, 1.8, 1.9, 0.9]
0:00:07.704329 1 [1.9, 3.6, 0.0, 0.9, 2.7, 0.9, 0.0, 0.0]
0:00:08.785177 1 [0.9, 1.9, 0.9, 0.0, 2.8, 2.8, 1.8, 0.0]
0:00:09.879134 1 [0.0, 1.9, 1.8, 0.0, 1.8, 1.8, 0.9, 1.8]

i.e. is it load of each core? In particular the first line seemed to be suspicious - is it measuring the whole system or only my program/process?

m3d commented 3 years ago

p.s. log from K2 would be interesting to see

tajgr commented 3 years ago

It is not ready for review :-). The output for cpu is for whole system and it is for each core. Yes, the first line is incorrect (probably) and I'm considering to skip the first measurement. Could you try it on windows?

m3d commented 3 years ago

Could you try it on windows?

maybe later tonight - I do not have any Windows notebook with me now