Back to index

munin  2.0.1
CompilationTimeTotal.java
Go to the documentation of this file.
00001 package org.munin.plugin.jmx;
00002 
00006 import java.io.IOException;
00007 import java.lang.management.CompilationMXBean;
00008 import java.lang.management.ManagementFactory;
00009 
00010 import org.munin.plugin.jmx.AbstractAnnotationGraphsProvider.Graph;
00011 
00012 @Graph(title = "CompilationTimeTotal", vlabel = "ms", info = "value does not indicate the level of performance of the Java virtual machine and is not intended for performance comparisons of different virtual machine implementations. The implementations may have different definitions and different measurements of the compilation time.")
00013 public class CompilationTimeTotal extends AbstractAnnotationGraphsProvider {
00014 
00015        public CompilationTimeTotal(Config config) {
00016               super(config);
00017        }
00018 
00019        @Field(info = "The approximate elapsed time (in milliseconds) spent in compilation. If multiple threads are used for compilation, this value is summation of the approximate time that each thread spent in compilation.", type = "DERIVE", min = 0)
00020        public long compilationTimeTotal() throws IOException {
00021               CompilationMXBean osmxbean = ManagementFactory.newPlatformMXBeanProxy(
00022                             getConnection(), ManagementFactory.COMPILATION_MXBEAN_NAME,
00023                             CompilationMXBean.class);
00024               return osmxbean.getTotalCompilationTime();
00025        }
00026 
00027        public static void main(String args[]) {
00028               runGraph(args);
00029        }
00030 }