當前位置: 首頁>>代碼示例>>Java>>正文


Java CompilationMXBean.isCompilationTimeMonitoringSupported方法代碼示例

本文整理匯總了Java中java.lang.management.CompilationMXBean.isCompilationTimeMonitoringSupported方法的典型用法代碼示例。如果您正苦於以下問題:Java CompilationMXBean.isCompilationTimeMonitoringSupported方法的具體用法?Java CompilationMXBean.isCompilationTimeMonitoringSupported怎麽用?Java CompilationMXBean.isCompilationTimeMonitoringSupported使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.lang.management.CompilationMXBean的用法示例。


在下文中一共展示了CompilationMXBean.isCompilationTimeMonitoringSupported方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: sense

import java.lang.management.CompilationMXBean; //導入方法依賴的package包/類
@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;
}
 
開發者ID:awslabs,項目名稱:swage,代碼行數:17,代碼來源:CompilationTimeSensor.java

示例2: main

import java.lang.management.CompilationMXBean; //導入方法依賴的package包/類
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");
    }
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:19,代碼來源:TestCompilation.java

示例3: main

import java.lang.management.CompilationMXBean; //導入方法依賴的package包/類
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");
     }
 }
 
開發者ID:nmldiegues,項目名稱:jvm-stm,代碼行數:19,代碼來源:TestCompilation.java

示例4: doCompilationMXBeanTest

import java.lang.management.CompilationMXBean; //導入方法依賴的package包/類
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 ;
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:41,代碼來源:MXBeanInteropTest1.java

示例5: getJITCompileTime

import java.lang.management.CompilationMXBean; //導入方法依賴的package包/類
/**
 * 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;
}
 
開發者ID:apache,項目名稱:systemml,代碼行數:16,代碼來源:Statistics.java

示例6: checkSupport

import java.lang.management.CompilationMXBean; //導入方法依賴的package包/類
@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;
    }
}
 
開發者ID:msteindorfer,項目名稱:jmh,代碼行數:11,代碼來源:CompilerProfiler.java


注:本文中的java.lang.management.CompilationMXBean.isCompilationTimeMonitoringSupported方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。