系统相关
首页 > 系统相关> > java-是否有用于分析yourkit快照(内存/ cpu)的API?

java-是否有用于分析yourkit快照(内存/ cpu)的API?

作者:互联网

YourKit提供了API for capturing CPU profiling(采样/跟踪).像下面这样的东西…

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用于分析捕获的数据?

解决方法:

有可以查询内存快照的API.请参见MemorySnapshot类http://www.yourkit.com/docs/java/api/com/yourkit/api/MemorySnapshot.html的JavaDoc和“设置描述语言” http://www.yourkit.com/docs/java/help/language.jsp

您也可以导出快照数据以进行进一步分析http://www.yourkit.com/docs/java/help/export.jsp

标签:api,profiling,yourkit,java
来源: https://codeday.me/bug/20191122/2056332.html