feat: add async-profiler start/stop demo#1
Draft
zhengziyi0117 wants to merge 16 commits into
Draft
Conversation
|
|
||
| public String elasticsearch() throws Exception { | ||
| String indexName = UUID.randomUUID().toString(); | ||
| String indexName2 = UUID.randomUUID().toString(); |
| import org.apache.skywalking.apm.network.language.profile.v3.ProfileTaskGrpc; | ||
| import org.apache.skywalking.apm.util.RunnableWithExceptionProtection; | ||
|
|
||
| import java.util.ArrayList; |
| */ | ||
| public byte[] stop(AsyncProfiler asyncProfiler) throws IOException { | ||
| LOGGER.info("async profiler process stop and dump file"); | ||
| asyncProfiler.stop(); |
There was a problem hiding this comment.
对于JFR来说这里这样处理是可以的,但是对于HTML来说其实是不行的。HTML的输出需要指定格式以及文件名
|
|
||
| public String start(AsyncProfiler asyncProfiler) throws IOException { | ||
| tempFile = Files.createFile(Paths.get("/Users/bytedance/IdeaProjects/skywalking-java/skywalking-output/" + taskId)); | ||
| execArgs = execArgs + "file=" + tempFile.toAbsolutePath(); |
| throws IllegalArgumentException, IOException { | ||
| LOGGER.info("async profiler execute arg:{}", arg); | ||
| String result = asyncProfiler.execute(arg); | ||
| if (!result.endsWith("\n")) { |
| private void stopAsyncProfile(AsyncProfilerTask task) { | ||
| try { | ||
| // execute stop task | ||
| byte[] data = task.stop(ASYNC_PROFILER); |
There was a problem hiding this comment.
我建议这里不要传bytes吧,应该传递File的引用,几百兆文件的话很占用内存
你分片上传的意义不就是要节约内存吗
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CHANGESlog.