|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectJVMProfiler
public class JVMProfiler
This code comes from Java Tip 92 on Javaworld.com (but was modified quite a bit) see http://www.javaworld.com/javaworld/javatips/jw-javatip92.html
It is an interface into the JVM Profiler and allows the cpu time for the current thread to be obtained (and possibly other things to be added later).
The program must use the command line java -Xrunjvm_profiler application
Field Summary | |
---|---|
static long |
nanosPerMilli
|
Constructor Summary | |
---|---|
JVMProfiler()
|
Method Summary | |
---|---|
static long |
getCurrentThreadCpuTime_native()
This will throw an unsatisfied link exception if loaded is not true. |
static long |
getCurrentThreadCpuTime()
Will return the CPU Time of the thread or else will return 0 if the profiler cannot be interfaced with. |
static long |
getCurrentThreadCpuTimeMS()
Will return the CPU Time of the thread or else will return 0 if the profiler cannot be interfaced with. |
static boolean |
loaded()
|
static void |
main(String[] args)
Test/debug |
static boolean |
profilerRunning_native()
Will return true if the command line to start the profiler was set, otherwise will return false. |
static boolean |
profilerRunning()
Will return true if the command line to start the profiler was set, otherwise will return false. |
Methods inherited from class Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long nanosPerMilli
Constructor Detail |
---|
public JVMProfiler()
Method Detail |
---|
public static boolean loaded()
public static long getCurrentThreadCpuTime_native()
public static boolean profilerRunning_native()
Will throw an unsatisfied link exception if loaded is not true.
public static long getCurrentThreadCpuTime()
public static long getCurrentThreadCpuTimeMS()
public static boolean profilerRunning()
public static void main(String[] args)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |