Java 类java.lang.management.CompilationMXBean 实例源码

项目:swage    文件:CompilationTimeSensor.java   
@Override
public void sense(final MetricRecorder.Context metricContext)
{
    CompilationMXBean mxBean = ManagementFactory.getCompilationMXBean();

    // Compilation time may not be supported on some platforms, skip if so.
    if (!mxBean.isCompilationTimeMonitoringSupported()) {
        return;
    }

    long total = mxBean.getTotalCompilationTime();
    metricContext.record(TOTAL_COMPILATION_TIME, total, Unit.MILLISECOND);
    metricContext.record(COMPILATION_TIME, total - prevTotal, Unit.MILLISECOND);

    this.prevTotal = total;
}
项目:javify    文件:TestCompilation.java   
public static void main(String[] args)
{
  CompilationMXBean bean = ManagementFactory.getCompilationMXBean();
  if (bean == null)
    {
      System.out.println("The compilation bean is not supported by this VM.");
      System.exit(-1);
    }
  System.out.println("Bean: " + bean);
  System.out.println("JIT compiler name: " + bean.getName());
  boolean timeMonitoring = bean.isCompilationTimeMonitoringSupported();
  System.out.println("Compilation time monitoring supported: " + timeMonitoring);
  if (timeMonitoring)
    {
      System.out.println("Compilation time: "
                         + bean.getTotalCompilationTime() + "ms");
    }
}
项目:jvm-stm    文件:TestCompilation.java   
public static void main(String[] args)
 {
   CompilationMXBean bean = ManagementFactory.getCompilationMXBean();
   if (bean == null)
     {
System.out.println("The compilation bean is not supported by this VM.");
System.exit(-1);
     }
   System.out.println("Bean: " + bean);
   System.out.println("JIT compiler name: " + bean.getName());
   boolean timeMonitoring = bean.isCompilationTimeMonitoringSupported();
   System.out.println("Compilation time monitoring supported: " + timeMonitoring);
   if (timeMonitoring)
     {
System.out.println("Compilation time: "
           + bean.getTotalCompilationTime() + "ms");
     }
 }
项目:astor    文件:JvmMetrics.java   
private static void writeJitMetrics(
    PrintStream out, boolean verbose, boolean pretty) {

  CompilationMXBean cBean = ManagementFactory.getCompilationMXBean();

  String name;
  if (verbose) {
    name = cBean.getName();
  } else {
    name = "total";
  }

  if (pretty) {
    out.println("\nJIT Stats");
    out.println(String.format(
        "\t%s jit time: %d ms", name, cBean.getTotalCompilationTime()));
  } else {
    out.println(normalizeTabularColonPos(String.format("%s-jit-time-ms : %d",
        normalizeName(name), cBean.getTotalCompilationTime())));
  }
}
项目:closure-compiler    文件:JvmMetrics.java   
private static void writeJitMetrics(
    PrintStream out, boolean verbose, boolean pretty) {

  CompilationMXBean cBean = ManagementFactory.getCompilationMXBean();

  String name;
  if (verbose) {
    name = cBean.getName();
  } else {
    name = "total";
  }

  if (pretty) {
    out.println("\nJIT Stats");
    out.printf("\t%s jit time: %d ms%n", name, cBean.getTotalCompilationTime());
  } else {
    out.println(normalizeTabularColonPos(String.format("%s-jit-time-ms : %d",
        normalizeName(name), cBean.getTotalCompilationTime())));
  }
}
项目:cn1    文件:ManagementUtils.java   
/**
 * Creates the metadata for the
 * {@link java.lang.management.CompilationMXBean}. For this type of
 * platform bean the metadata covers :
 * <ul>
 * <li>3 attributes
 * <li>0 constructors
 * <li>0 operations
 * <li>0 notifications
 * </ul>
 * 
 * @param result
 */
private static void addCompilationBeanInfo(HashMap<String, MBeanInfo> result) {
    // Attributes
    MBeanAttributeInfo[] attributes = new MBeanAttributeInfo[3];
    attributes[0] = new MBeanAttributeInfo("Name", String.class.getName(),
            "Name", true, false, false);
    attributes[1] = new MBeanAttributeInfo("TotalCompilationTime",
            Long.TYPE.getName(), "TotalCompilationTime", true, false, false);
    attributes[2] = new MBeanAttributeInfo(
            "CompilationTimeMonitoringSupported", Boolean.TYPE.getName(),
            "CompilationTimeMonitoringSupported", true, false, true);
    result.put(CompilationMXBean.class.getName(), new MBeanInfo(
            CompilationMXBeanImpl.class.getName(),
            CompilationMXBeanImpl.class.getName(), attributes, null, null,
            null));
}
项目:JamVM-PH    文件:TestCompilation.java   
public static void main(String[] args)
 {
   CompilationMXBean bean = ManagementFactory.getCompilationMXBean();
   if (bean == null)
     {
System.out.println("The compilation bean is not supported by this VM.");
System.exit(-1);
     }
   System.out.println("Bean: " + bean);
   System.out.println("JIT compiler name: " + bean.getName());
   boolean timeMonitoring = bean.isCompilationTimeMonitoringSupported();
   System.out.println("Compilation time monitoring supported: " + timeMonitoring);
   if (timeMonitoring)
     {
System.out.println("Compilation time: "
           + bean.getTotalCompilationTime() + "ms");
     }
 }
项目:classpath    文件:TestCompilation.java   
public static void main(String[] args)
{
  CompilationMXBean bean = ManagementFactory.getCompilationMXBean();
  if (bean == null)
    {
      System.out.println("The compilation bean is not supported by this VM.");
      System.exit(-1);
    }
  System.out.println("Bean: " + bean);
  System.out.println("JIT compiler name: " + bean.getName());
  boolean timeMonitoring = bean.isCompilationTimeMonitoringSupported();
  System.out.println("Compilation time monitoring supported: " + timeMonitoring);
  if (timeMonitoring)
    {
      System.out.println("Compilation time: "
                         + bean.getTotalCompilationTime() + "ms");
    }
}
项目:freeVM    文件:ManagementUtils.java   
/**
 * Creates the metadata for the
 * {@link java.lang.management.CompilationMXBean}. For this type of
 * platform bean the metadata covers :
 * <ul>
 * <li>3 attributes
 * <li>0 constructors
 * <li>0 operations
 * <li>0 notifications
 * </ul>
 * 
 * @param result
 */
private static void addCompilationBeanInfo(HashMap<String, MBeanInfo> result) {
    // Attributes
    MBeanAttributeInfo[] attributes = new MBeanAttributeInfo[3];
    attributes[0] = new MBeanAttributeInfo("Name", String.class.getName(),
            "Name", true, false, false);
    attributes[1] = new MBeanAttributeInfo("TotalCompilationTime",
            Long.TYPE.getName(), "TotalCompilationTime", true, false, false);
    attributes[2] = new MBeanAttributeInfo(
            "CompilationTimeMonitoringSupported", Boolean.TYPE.getName(),
            "CompilationTimeMonitoringSupported", true, false, true);
    result.put(CompilationMXBean.class.getName(), new MBeanInfo(
            CompilationMXBeanImpl.class.getName(),
            CompilationMXBeanImpl.class.getName(), attributes, null, null,
            null));
}
项目:freeVM    文件:ManagementUtils.java   
/**
 * Creates the metadata for the
 * {@link java.lang.management.CompilationMXBean}. For this type of
 * platform bean the metadata covers :
 * <ul>
 * <li>3 attributes
 * <li>0 constructors
 * <li>0 operations
 * <li>0 notifications
 * </ul>
 * 
 * @param result
 */
private static void addCompilationBeanInfo(HashMap<String, MBeanInfo> result) {
    // Attributes
    MBeanAttributeInfo[] attributes = new MBeanAttributeInfo[3];
    attributes[0] = new MBeanAttributeInfo("Name", String.class.getName(),
            "Name", true, false, false);
    attributes[1] = new MBeanAttributeInfo("TotalCompilationTime",
            Long.TYPE.getName(), "TotalCompilationTime", true, false, false);
    attributes[2] = new MBeanAttributeInfo(
            "CompilationTimeMonitoringSupported", Boolean.TYPE.getName(),
            "CompilationTimeMonitoringSupported", true, false, true);
    result.put(CompilationMXBean.class.getName(), new MBeanInfo(
            CompilationMXBeanImpl.class.getName(),
            CompilationMXBeanImpl.class.getName(), attributes, null, null,
            null));
}
项目:closure-compiler-old    文件:JvmMetrics.java   
private static void writeJitMetrics(
    PrintStream out, boolean verbose, boolean pretty) {

  CompilationMXBean cBean = ManagementFactory.getCompilationMXBean();

  String name;
  if (verbose) {
    name = cBean.getName();
  } else {
    name = "total";
  }

  if (pretty) {
    out.println("\nJIT Stats");
    out.println(String.format(
        "\t%s jit time: %d ms", name, cBean.getTotalCompilationTime()));
  } else {
    out.println(normalizeTabularColonPos(String.format("%s-jit-time-ms : %d",
        normalizeName(name), cBean.getTotalCompilationTime())));
  }
}
项目:closure-compiler-copy    文件:JvmMetrics.java   
private static void writeJitMetrics(
    PrintStream out, boolean verbose, boolean pretty) {

  CompilationMXBean cBean = ManagementFactory.getCompilationMXBean();

  String name;
  if (verbose) {
    name = cBean.getName();
  } else {
    name = "total";
  }

  if (pretty) {
    out.println("\nJIT Stats");
    out.println(String.format(
        "\t%s jit time: %d ms", name, cBean.getTotalCompilationTime()));
  } else {
    out.println(normalizeTabularColonPos(String.format("%s-jit-time-ms : %d",
        normalizeName(name), cBean.getTotalCompilationTime())));
  }
}
项目:jdk8u-jdk    文件:MXBeanInteropTest1.java   
private final int doCompilationMXBeanTest(MBeanServerConnection mbsc) {
    int errorCount = 0 ;
    System.out.println("---- CompilationMXBean") ;

    try {
        ObjectName compilationName =
                new ObjectName(ManagementFactory.COMPILATION_MXBEAN_NAME);

        if ( mbsc.isRegistered(compilationName) ) {
            MBeanInfo mbInfo = mbsc.getMBeanInfo(compilationName);
            errorCount += checkNonEmpty(mbInfo);
            System.out.println("getMBeanInfo\t\t" + mbInfo);
            CompilationMXBean compilation = null ;

            compilation =
                    JMX.newMXBeanProxy(mbsc,
                    compilationName,
                    CompilationMXBean.class) ;
            System.out.println("getName\t\t"
                    + compilation.getName());
            boolean supported =
                    compilation.isCompilationTimeMonitoringSupported() ;
            System.out.println("isCompilationTimeMonitoringSupported\t\t"
                    + supported);

            if ( supported ) {
                System.out.println("getTotalCompilationTime\t\t"
                        + compilation.getTotalCompilationTime());
            }
        }

        System.out.println("---- OK\n") ;
    } catch (Exception e) {
        Utils.printThrowable(e, true) ;
        errorCount++ ;
        System.out.println("---- ERROR\n") ;
    }

    return errorCount ;
}
项目:openjdk-jdk10    文件:MXBeanInteropTest1.java   
private final int doCompilationMXBeanTest(MBeanServerConnection mbsc) {
    int errorCount = 0 ;
    System.out.println("---- CompilationMXBean") ;

    try {
        ObjectName compilationName =
                new ObjectName(ManagementFactory.COMPILATION_MXBEAN_NAME);

        if ( mbsc.isRegistered(compilationName) ) {
            MBeanInfo mbInfo = mbsc.getMBeanInfo(compilationName);
            errorCount += checkNonEmpty(mbInfo);
            System.out.println("getMBeanInfo\t\t" + mbInfo);
            CompilationMXBean compilation = null ;

            compilation =
                    JMX.newMXBeanProxy(mbsc,
                    compilationName,
                    CompilationMXBean.class) ;
            System.out.println("getName\t\t"
                    + compilation.getName());
            boolean supported =
                    compilation.isCompilationTimeMonitoringSupported() ;
            System.out.println("isCompilationTimeMonitoringSupported\t\t"
                    + supported);

            if ( supported ) {
                System.out.println("getTotalCompilationTime\t\t"
                        + compilation.getTotalCompilationTime());
            }
        }

        System.out.println("---- OK\n") ;
    } catch (Exception e) {
        Utils.printThrowable(e, true) ;
        errorCount++ ;
        System.out.println("---- ERROR\n") ;
    }

    return errorCount ;
}
项目:openjdk9    文件:MXBeanInteropTest1.java   
private final int doCompilationMXBeanTest(MBeanServerConnection mbsc) {
    int errorCount = 0 ;
    System.out.println("---- CompilationMXBean") ;

    try {
        ObjectName compilationName =
                new ObjectName(ManagementFactory.COMPILATION_MXBEAN_NAME);

        if ( mbsc.isRegistered(compilationName) ) {
            MBeanInfo mbInfo = mbsc.getMBeanInfo(compilationName);
            errorCount += checkNonEmpty(mbInfo);
            System.out.println("getMBeanInfo\t\t" + mbInfo);
            CompilationMXBean compilation = null ;

            compilation =
                    JMX.newMXBeanProxy(mbsc,
                    compilationName,
                    CompilationMXBean.class) ;
            System.out.println("getName\t\t"
                    + compilation.getName());
            boolean supported =
                    compilation.isCompilationTimeMonitoringSupported() ;
            System.out.println("isCompilationTimeMonitoringSupported\t\t"
                    + supported);

            if ( supported ) {
                System.out.println("getTotalCompilationTime\t\t"
                        + compilation.getTotalCompilationTime());
            }
        }

        System.out.println("---- OK\n") ;
    } catch (Exception e) {
        Utils.printThrowable(e, true) ;
        errorCount++ ;
        System.out.println("---- ERROR\n") ;
    }

    return errorCount ;
}
项目:jdk8u_jdk    文件:MXBeanInteropTest1.java   
private final int doCompilationMXBeanTest(MBeanServerConnection mbsc) {
    int errorCount = 0 ;
    System.out.println("---- CompilationMXBean") ;

    try {
        ObjectName compilationName =
                new ObjectName(ManagementFactory.COMPILATION_MXBEAN_NAME);

        if ( mbsc.isRegistered(compilationName) ) {
            MBeanInfo mbInfo = mbsc.getMBeanInfo(compilationName);
            errorCount += checkNonEmpty(mbInfo);
            System.out.println("getMBeanInfo\t\t" + mbInfo);
            CompilationMXBean compilation = null ;

            compilation =
                    JMX.newMXBeanProxy(mbsc,
                    compilationName,
                    CompilationMXBean.class) ;
            System.out.println("getName\t\t"
                    + compilation.getName());
            boolean supported =
                    compilation.isCompilationTimeMonitoringSupported() ;
            System.out.println("isCompilationTimeMonitoringSupported\t\t"
                    + supported);

            if ( supported ) {
                System.out.println("getTotalCompilationTime\t\t"
                        + compilation.getTotalCompilationTime());
            }
        }

        System.out.println("---- OK\n") ;
    } catch (Exception e) {
        Utils.printThrowable(e, true) ;
        errorCount++ ;
        System.out.println("---- ERROR\n") ;
    }

    return errorCount ;
}
项目:lookaside_java-1.8.0-openjdk    文件:MXBeanInteropTest1.java   
private final int doCompilationMXBeanTest(MBeanServerConnection mbsc) {
    int errorCount = 0 ;
    System.out.println("---- CompilationMXBean") ;

    try {
        ObjectName compilationName =
                new ObjectName(ManagementFactory.COMPILATION_MXBEAN_NAME);

        if ( mbsc.isRegistered(compilationName) ) {
            MBeanInfo mbInfo = mbsc.getMBeanInfo(compilationName);
            errorCount += checkNonEmpty(mbInfo);
            System.out.println("getMBeanInfo\t\t" + mbInfo);
            CompilationMXBean compilation = null ;

            compilation =
                    JMX.newMXBeanProxy(mbsc,
                    compilationName,
                    CompilationMXBean.class) ;
            System.out.println("getName\t\t"
                    + compilation.getName());
            boolean supported =
                    compilation.isCompilationTimeMonitoringSupported() ;
            System.out.println("isCompilationTimeMonitoringSupported\t\t"
                    + supported);

            if ( supported ) {
                System.out.println("getTotalCompilationTime\t\t"
                        + compilation.getTotalCompilationTime());
            }
        }

        System.out.println("---- OK\n") ;
    } catch (Exception e) {
        Utils.printThrowable(e, true) ;
        errorCount++ ;
        System.out.println("---- ERROR\n") ;
    }

    return errorCount ;
}
项目:jmxmon    文件:ProxyClient.java   
public synchronized CompilationMXBean getCompilationMXBean() throws IOException {
    if (hasCompilationMXBean && compilationMBean == null) {
        compilationMBean =
            newPlatformMXBeanProxy(server, COMPILATION_MXBEAN_NAME,
                                   CompilationMXBean.class);
    }
    return compilationMBean;
}
项目:systemml    文件:Statistics.java   
/**
 * Returns the total time of asynchronous JIT compilation in milliseconds.
 * 
 * @return JIT compile time
 */
public static long getJITCompileTime(){
    long ret = -1; //unsupported
    CompilationMXBean cmx = ManagementFactory.getCompilationMXBean();
    if( cmx.isCompilationTimeMonitoringSupported() )
    {
        ret = cmx.getTotalCompilationTime();
        ret += jitCompileTime; //add from remote processes
    }
    return ret;
}
项目:jvmtop    文件:ProxyClient.java   
public synchronized CompilationMXBean getCompilationMXBean() throws IOException {
    if (hasCompilationMXBean && compilationMBean == null) {
        compilationMBean =
            newPlatformMXBeanProxy(server, COMPILATION_MXBEAN_NAME,
                                   CompilationMXBean.class);
    }
    return compilationMBean;
}
项目:cn1    文件:ManagementFactoryTest.java   
public void testGetCompilationMXBean() {
    CompilationMXBean mb = ManagementFactory.getCompilationMXBean();
    assertNotNull(mb);

    // Verify that there is only instance of this bean
    CompilationMXBean mb2 = ManagementFactory.getCompilationMXBean();
    assertNotNull(mb2);
    assertSame(mb, mb2);
}
项目:cn1    文件:ManagementFactoryTest.java   
public void testNewPlatformMXBeanProxy_CompilationMXBean() throws Exception {
    CompilationMXBean proxy = ManagementFactory.newPlatformMXBeanProxy(
            ManagementFactory.getPlatformMBeanServer(),
            "java.lang:type=Compilation", CompilationMXBean.class);
    assertNotNull(proxy);
    CompilationMXBean mb = ManagementFactory.getCompilationMXBean();
    assertEquals(mb.getName(), proxy.getName());
    assertEquals(mb.isCompilationTimeMonitoringSupported(), proxy
            .isCompilationTimeMonitoringSupported());
}
项目:jmh    文件:CompilerProfiler.java   
@Override
public boolean checkSupport(List<String> msgs) {
    CompilationMXBean comp = ManagementFactory.getCompilationMXBean();
    if (comp.isCompilationTimeMonitoringSupported()) {
        return true;
    } else {
        msgs.add("The MXBean is available, but compilation time monitoring is disabled.");
        return false;
    }
}
项目:jmh    文件:CompilerProfiler.java   
@Override
public void beforeIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams) {
    CompilationMXBean comp = ManagementFactory.getCompilationMXBean();
    try {
        startCompTime = comp.getTotalCompilationTime();
    } catch (UnsupportedOperationException e) {
        startCompTime = -1;
    }
}
项目:jmh    文件:CompilerProfiler.java   
@Override
public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams) {
    long compTime = -startCompTime;
    CompilationMXBean comp = ManagementFactory.getCompilationMXBean();
    try {
        compTime += comp.getTotalCompilationTime();
    } catch (UnsupportedOperationException e) {
        compTime = -1;
    }

    return Arrays.asList(
            new ProfilerResult("@compiler.time.profiled", compTime, "ms", AggregationPolicy.SUM),
            new ProfilerResult("@compiler.time.total", comp.getTotalCompilationTime(), "ms", AggregationPolicy.MAX)
    );
}
项目:commander-shell    文件:JVM.java   
@Override
public void run() {
    CompilationMXBean compilationMXBean = ManagementFactory.getCompilationMXBean();
    if (compilationMXBean == null) {
        output.println("Couldn't get the runtime bean!");
        return;
    }
    output.println(compilationMXBean.getTotalCompilationTime());
}
项目:freeVM    文件:ManagementFactoryTest.java   
public void testGetCompilationMXBean() {
    CompilationMXBean mb = ManagementFactory.getCompilationMXBean();
    assertNotNull(mb);

    // Verify that there is only instance of this bean
    CompilationMXBean mb2 = ManagementFactory.getCompilationMXBean();
    assertNotNull(mb2);
    assertSame(mb, mb2);
}
项目:freeVM    文件:ManagementFactoryTest.java   
public void testNewPlatformMXBeanProxy_CompilationMXBean() throws Exception {
    CompilationMXBean proxy = ManagementFactory.newPlatformMXBeanProxy(
            ManagementFactory.getPlatformMBeanServer(),
            "java.lang:type=Compilation", CompilationMXBean.class);
    assertNotNull(proxy);
    CompilationMXBean mb = ManagementFactory.getCompilationMXBean();
    assertEquals(mb.getName(), proxy.getName());
    assertEquals(mb.isCompilationTimeMonitoringSupported(), proxy
            .isCompilationTimeMonitoringSupported());
}
项目:freeVM    文件:ManagementFactoryTest.java   
public void testGetCompilationMXBean() {
    CompilationMXBean mb = ManagementFactory.getCompilationMXBean();
    assertNotNull(mb);

    // Verify that there is only instance of this bean
    CompilationMXBean mb2 = ManagementFactory.getCompilationMXBean();
    assertNotNull(mb2);
    assertSame(mb, mb2);
}
项目:freeVM    文件:ManagementFactoryTest.java   
public void testNewPlatformMXBeanProxy_CompilationMXBean() throws Exception {
    CompilationMXBean proxy = ManagementFactory.newPlatformMXBeanProxy(
            ManagementFactory.getPlatformMBeanServer(),
            "java.lang:type=Compilation", CompilationMXBean.class);
    assertNotNull(proxy);
    CompilationMXBean mb = ManagementFactory.getCompilationMXBean();
    assertEquals(mb.getName(), proxy.getName());
    assertEquals(mb.isCompilationTimeMonitoringSupported(), proxy
            .isCompilationTimeMonitoringSupported());
}
项目:incubator-netbeans    文件:DiagnosticTask.java   
private String logParams() {
        StringBuilder sb = new StringBuilder(500);
        sb.append("Diagnostic information\n");
        try {
            RuntimeMXBean         rmBean     = ManagementFactory.getRuntimeMXBean();
            CompilationMXBean     cmpMBean   = ManagementFactory.getCompilationMXBean();
//            ThreadMXBean          tmBean     = ManagementFactory.getThreadMXBean();
            MemoryMXBean          memoryBean = ManagementFactory.getMemoryMXBean();
            ClassLoadingMXBean    clMBean    = ManagementFactory.getClassLoadingMXBean();

//            MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
//            ObjectName hsDiag = new ObjectName("com.sun.management:name=HotSpotDiagnostic");
//            com.sun.management.OperatingSystemMXBean sunOSMBean  =
//               ManagementFactory.getSunOperatingSystemMXBean();

//            Map<String, String> props = new TreeMap<String, String>(rmBean.getSystemProperties());
//            System.out.println("System properties");
//            for (Map.Entry<String, String> entry: props.entrySet()) {
//                System.out.println("Property: "+entry.getKey()+" Value: "+entry.getValue());
//            }
            sb.append("Input arguments:");
            for (String s: rmBean.getInputArguments()) {
                sb.append("\n\t").append(s);
            }

            if (cmpMBean != null) {
                sb.append("\nCompiler: "+cmpMBean.getName()).append('\n');
            }

            // Memory
            MemoryUsage usage = memoryBean.getHeapMemoryUsage();
            logMemoryUsage(sb, usage, "Heap memory");
            usage = memoryBean.getNonHeapMemoryUsage();
            logMemoryUsage(sb, usage, "Non heap memory");
            for (GarbageCollectorMXBean gcMBean: ManagementFactory.getGarbageCollectorMXBeans()) {
                sb.append("Garbage collector: ").append(gcMBean.getName())
                        .append(" (Collections=").append(gcMBean.getCollectionCount())
                        .append(" Total time spent=").append(formatTime(gcMBean.getCollectionTime()))
                        .append(")\n");
            }

            // classes
            int clsLoaded;
            long clsTotal, clsUnloaded;
            clsLoaded = clMBean.getLoadedClassCount();
            clsTotal = clMBean.getTotalLoadedClassCount();
            clsUnloaded = clMBean.getUnloadedClassCount();
            sb.append("Classes: loaded=").append(clsLoaded)
                    .append(" total loaded=").append(clsTotal)
                    .append(" unloaded ").append(clsUnloaded).append('\n');

//        } catch (MalformedObjectNameException ex) {
//            Logger.getLogger("global").log(Level.WARNING, null, ex);
        } catch (NullPointerException ex) {
            LOG.log(Level.WARNING, null, ex);
        }
        return sb.toString();
    }
项目:OpenJSharp    文件:JvmCompilationImpl.java   
private static CompilationMXBean getCompilationMXBean() {
    return ManagementFactory.getCompilationMXBean();
}
项目:jdk8u-jdk    文件:JvmCompilationImpl.java   
private static CompilationMXBean getCompilationMXBean() {
    return ManagementFactory.getCompilationMXBean();
}
项目:java-performance    文件:Compilation.java   
public static void main(String[] args) {
    CompilationMXBean compilationMXBean = ManagementFactory.getCompilationMXBean();
    System.out.println("Total compilation time: " + compilationMXBean.getTotalCompilationTime());
}
项目:ServerAgent    文件:CompilerDataProvider.java   
protected Class<CompilationMXBean> getMXBeanClass() {
    return CompilationMXBean.class;
}
项目:ServerAgent    文件:CompilerDataProvider.java   
protected long getValueFromBean(Object bean) {
    return ((CompilationMXBean) bean).getTotalCompilationTime();
}
项目:jdk8u_jdk    文件:JvmCompilationImpl.java   
private static CompilationMXBean getCompilationMXBean() {
    return ManagementFactory.getCompilationMXBean();
}
项目:lookaside_java-1.8.0-openjdk    文件:JvmCompilationImpl.java   
private static CompilationMXBean getCompilationMXBean() {
    return ManagementFactory.getCompilationMXBean();
}
项目:infobip-open-jdk-8    文件:JvmCompilationImpl.java   
private static CompilationMXBean getCompilationMXBean() {
    return ManagementFactory.getCompilationMXBean();
}
项目:jdk8u-dev-jdk    文件:JvmCompilationImpl.java   
private static CompilationMXBean getCompilationMXBean() {
    return ManagementFactory.getCompilationMXBean();
}