JavaSysMon cpuFrequencyInHz for Linux system

63 views
Skip to first unread message

Xang Xiong

unread,
Nov 30, 2011, 7:50:11 PM11/30/11
to JavaSysMon
I'm using the cpuFrequencyInHz on a Linux system and it seems to work
for system that have /proc/cpuinfo that outputs the model name of the
cpu with a '@' separating the model name and the cpu speed. I have a
Dell 1750 running a VMWare ESXi 3.5 with a CentOS 5.7 32-bit
installation that outputs the /proc/cpuinfo without the '@' separating
the model name and speed. The output is 'model name : Intel(R)
Xeon(TM) CPU 3.06GHz'.

When using JavaSysMon on that CentOS installation, JavaSysMon would
fail to retrieve the cpu frequency. I look through the code and it
seems the reqular expression CPU_FREQ_PATTERN does not cover the case
when a model name does not have the '@' symbol. I've made the fix for
my version of JavaSysMon, but just wanted to let the community know
that this issue does exists and I'll be willing to provide my work
around it necessary.

Tristan ter Haar

unread,
Jul 25, 2014, 12:17:22 PM7/25/14
to javas...@googlegroups.com
Could you please share your code?
I'm currently having the same problem.

Op donderdag 1 december 2011 01:50:11 UTC+1 schreef Xang Xiong:
installation that outputs the /proc/cpuinfo without the '@' separating
the model name and speed.  The output is 'model name        : Intel(R)
Xeon(TM) CPU 3.06GHz'. 
JavaSysMon would fail to retrieve the cpu frequency.  I look through the code and it

Xang Xiong

unread,
Jul 25, 2014, 1:00:17 PM7/25/14
to javas...@googlegroups.com
I don't quite remember the regular expression I used, but the line to change is line 31 of LinuxMonitor.java

Xang
--
You received this message because you are subscribed to the Google Groups "JavaSysMon" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javasysmon+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tristan ter Haar

unread,
Jul 25, 2014, 1:08:14 PM7/25/14
to javas...@googlegroups.com
I knew that that would be the line that needs to be edited, but I can't write the regular expression myself...., (never learned how to do so...)
Thanks for your response anyways! Will hardcode the CPU speed for now..

Op vrijdag 25 juli 2014 19:00:17 UTC+2 schreef Xang Xiong:

Xang Xiong

unread,
Jul 25, 2014, 7:56:39 PM7/25/14
to javas...@googlegroups.com
Try this regular expression:

"model name[^@]*@{0,1}\\s+([0-9.A-Za-z]*)"

Xang
Reply all
Reply to author
Forward
0 new messages