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


Java CompilationMXBean.getTotalCompilationTime方法代碼示例

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


在下文中一共展示了CompilationMXBean.getTotalCompilationTime方法的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: 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

示例3: beforeIteration

import java.lang.management.CompilationMXBean; //導入方法依賴的package包/類
@Override
public void beforeIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams) {
    CompilationMXBean comp = ManagementFactory.getCompilationMXBean();
    try {
        startCompTime = comp.getTotalCompilationTime();
    } catch (UnsupportedOperationException e) {
        startCompTime = -1;
    }
}
 
開發者ID:msteindorfer,項目名稱:jmh,代碼行數:10,代碼來源:CompilerProfiler.java

示例4: afterIteration

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

示例5: getCompilationTime

import java.lang.management.CompilationMXBean; //導入方法依賴的package包/類
long getCompilationTime() {
  CompilationMXBean bean = ManagementFactory.getCompilationMXBean();
  return bean.getTotalCompilationTime();
}
 
開發者ID:toddlipcon,項目名稱:mr-collector-benchmark,代碼行數:5,代碼來源:MapOutputCollectorBenchmark.java

示例6: run

import java.lang.management.CompilationMXBean; //導入方法依賴的package包/類
public void run() {

        TelemetryDataDto telemetryDataDto = new TelemetryDataDto();

        telemetryDataDto.time = System.currentTimeMillis();

        Runtime runtime = Runtime.getRuntime();

        telemetryDataDto.freeMemory = runtime.freeMemory();
        telemetryDataDto.maxMemory = runtime.maxMemory();
        telemetryDataDto.totalMemory = runtime.totalMemory();

        ClassLoadingMXBean classLoadingMXBean = ManagementFactory.getClassLoadingMXBean();

        telemetryDataDto.loadedClassCount = classLoadingMXBean.getLoadedClassCount();
        telemetryDataDto.classCount = classLoadingMXBean.getTotalLoadedClassCount();
        telemetryDataDto.unloadedClassCount = classLoadingMXBean.getUnloadedClassCount();

        CompilationMXBean compilationMXBean = ManagementFactory.getCompilationMXBean();

        telemetryDataDto.totalCompilationTime = compilationMXBean.getTotalCompilationTime();

        if (null != profiler)
            profiler.sendMessage(new TelemetryDataMessage(telemetryDataDto));

    }
 
開發者ID:bedrin,項目名稱:jsonde,代碼行數:27,代碼來源:TelemetryDataProvider.java


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