本文介绍了是有条约到条约yourkit快照(内存/ CPU)的API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

YourKit提供(采样/跟踪) 。有些东西像下面...

YourKit provides API for capturing CPU profiling (sampling/tracing). Some thing like below...

import com.yourkit.api.Controller;

import java.awt.*;
import java.io.File;

/**
 * to understand yourkit api.....
 */
public class AppMain {
    public static void main(String[] args) throws Exception {
        Controller yourKitController = new Controller();

        yourKitController.startCPUSampling(null);

        AnApplication anApplication = new AnApplication();
        anApplication.count(1000090);

        yourKitController.stopCPUProfiling();
        String savedFilePath = yourKitController.captureSnapshot(Controller.SNAPSHOT_WITHOUT_HEAP);

        File savedFile = new File(savedFilePath);
        Desktop.getDesktop().open(savedFile);

    }
}

我不能为分析捕获的数据发现API。是否有一个yourkit API用于分析捕获的数据?

I could not find API for analysing the captured data. Is there a yourkit API for analyzing captured data?

推荐答案

有是API,它允许查询内存快照。见MemorySnapshot类和设置描述语言的

There is API which allows to query memory snapshots. See JavaDoc of MemorySnapshot class http://www.yourkit.com/docs/java/api/com/yourkit/api/MemorySnapshot.html and "Set Description Language" http://www.yourkit.com/docs/java/help/language.jsp

你也可以导出快照数据作进一步分析

Also you can export snapshot data for further analyzes http://www.yourkit.com/docs/java/help/export.jsp

这篇关于是有条约到条约yourkit快照(内存/ CPU)的API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-27 07:23
查看更多