Get Windows "load average" in Java -


i'm writing java application needs @ how "heavily loaded" machine it's running on is. on *nix, load average divided number of processors fits bill perfectly, , retrieve load average managementfactory.getoperatingsystemmxbean().getsystemloadaverage(). unfortunately, returns -1 on windows, call apparently "expensive" called frequently. what's easiest way retrieve similar windows metrics such processor queue length or cpu utilisation, either in pure java or via jni?

you can retrieve cpu utilization on windows using wmi. code , documentation accessing wmi java appears available here.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -