CPU Stats

12 views
Skip to first unread message

James Lynes

unread,
Jun 14, 2020, 3:51:29 AM6/14/20
to HiPi Perl
RPi::WiringPi supports cpu_percent, mem_percent, and core_temp cpu statistics functions. Does HiPi support any of these?

Thanks,
James

Mark Dootson

unread,
Jun 14, 2020, 8:23:34 AM6/14/20
to HiPi Perl
These are not wrapped within HiPi. I may extend HiPi in future. I currently just use basic commands when I need this info - cat /proc/stats, cat /proc/meminfo, vcgencmd measure_temp, etc.

However, module RPi::SysInfo https://metacpan.org/pod/RPi::SysInfo  is a separate distribution and provides these functions to RPi::WiringPi.  It is not dependent on RPi::WiringPi so you could use RPi::SysInfo directly without loading RPi::WiringPi.

Regards

Mark

James Lynes

unread,
Jun 14, 2020, 9:55:06 AM6/14/20
to HiPi Perl
Great info!

I found vcgencmd and Sysinfo last night. I saw that Steve was calling vcgencmd with back tics, but I hit a dead end when he was calling cpuPercent and memPercent. I couldn't find either of these functions. I guess they are in a system library.

I didn't know that Sysinfo could be used stand alone. That will do what I need.

I have now ported four scripts. Painless process. All are working fine. The next one uses I2C, so I expect a little steeper learning curve.

Thanks,
James

James Lynes

unread,
Jun 22, 2020, 3:45:44 PM6/22/20
to HiPi Perl
Have now tested RPi::SysInfo along with HiPi in a test script that prints CPU and Memory utilization and CPU temperature in degC and degF. All works fine.

James
Reply all
Reply to author
Forward
0 new messages