| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Pls fix CI |
Sorry, something went wrong.
…/apm/agent/core/conf/Config.java Co-authored-by: Jiajing LU <lujiajing1126@gmail.com>
…/apm/agent/core/conf/Config.java Co-authored-by: Jiajing LU <lujiajing1126@gmail.com>
…/apm/agent/core/conf/Config.java Co-authored-by: Jiajing LU <lujiajing1126@gmail.com>
…/apm/agent/core/conf/Config.java Co-authored-by: Jiajing LU <lujiajing1126@gmail.com>
| * Wait briefly to see if the server can receive the jfr. If the server cannot receive it, onError will be triggered. | ||
| * Then we wait for a while (waiting for the server to send onError) and then decide whether to send the jfr file. | ||
| */ | ||
| Thread.sleep(500); |
There was a problem hiding this comment.
@wu-sheng In the current design, the Java Agent has to wait after the first request in order to determine whether the OAP accepts the following data transfer. This is a kind of negotiation.
WDYT?
Sorry, something went wrong.
There was a problem hiding this comment.
If you need to wait for the server, you should change AsyncProfilerTask service to dual streaming, and the response needs to be a kind of ack
Sorry, something went wrong.
There was a problem hiding this comment.
500ms can't guarantee anything AFAIK.
Sorry, something went wrong.
There was a problem hiding this comment.
If you need to wait for the server, you should change AsyncProfilerTask service to dual streaming, and the response needs to be a kind of ack
Sure. Let's use dual streaming @zhengziyi0117
Sorry, something went wrong.
There was a problem hiding this comment.
Note, in this case, Command should not be the response anymore.
Sorry, something went wrong.
| */ | ||
| Thread.sleep(500); | ||
|
|
||
| // Is it possible to upload jfr? |
There was a problem hiding this comment.
What does this comment mean?
Sorry, something went wrong.
| <dependency> | ||
| <groupId>tools.profiler</groupId> | ||
| <artifactId>async-profiler</artifactId> | ||
| <version>${async-profiler.version}</version> | ||
| </dependency> |
There was a problem hiding this comment.
Please move this the last one rather than the first.
Sorry, something went wrong.
|
|
||
| <!-- core lib dependency --> | ||
| <bytebuddy.version>1.14.9</bytebuddy.version> | ||
| <async-profiler.version>3.0</async-profiler.version> |
There was a problem hiding this comment.
Please move this the last one rather than the first.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM if all the current comments are resolved
Sorry, something went wrong.
|
|
||
| @Override | ||
| public void shutdown() throws Throwable { | ||
| scheduledFuture.cancel(true); |
There was a problem hiding this comment.
you have to check NULL!
Sorry, something went wrong.
| Commands commands = asyncProfilerTaskBlockingStub.withDeadlineAfter(GRPC_UPSTREAM_TIMEOUT, TimeUnit.SECONDS) | ||
| .getAsyncProfilerTaskCommands(query); | ||
| ServiceManager.INSTANCE.findService(CommandService.class).receiveCommand(commands); |
There was a problem hiding this comment.
You should check service not implemented error of gRPC, you could try that by connecting v < 10.1 OAP.
Sorry, something went wrong.
There was a problem hiding this comment.
Once it is not implemented, the agent should shutdown this part automatically.
Sorry, something went wrong.
| profile.dump_max_stack_depth=${SW_AGENT_PROFILE_DUMP_MAX_STACK_DEPTH:500} | ||
| # Snapshot transport to backend buffer size | ||
| profile.snapshot_transport_buffer_size=${SW_AGENT_PROFILE_SNAPSHOT_TRANSPORT_BUFFER_SIZE:4500} | ||
| # If true, Async Profiler will be enabled when user creates a new async profiler task, Otherwise it is disabled. |
There was a problem hiding this comment.
This comment is not accurate. You hard coded this value as true, so, the default value is TRUE, not disabled. Please update your default value in the codes.
Sorry, something went wrong.
| @DefaultImplementor | ||
| public class AsyncProfilerDataSender implements BootService, GRPCChannelListener { | ||
| private static final ILog LOGGER = LogManager.getLogger(ProfileSnapshotSender.class); | ||
| private static final int DATA_CHUNK_SIZE = 1024 * 1024; |
There was a problem hiding this comment.
This should move into config. Don't have to expose through agent.config, but we don't need to hard code this.
Sorry, something went wrong.
| status.finished(); | ||
| ServiceManager.INSTANCE.findService(GRPCChannelManager.class).reportError(t); |
There was a problem hiding this comment.
When onError, we should output logs.
Sorry, something went wrong.
|
|
||
| private static final ILog LOGGER = LogManager.getLogger(AsyncProfilerTaskChannelService.class); | ||
|
|
||
| private static final AsyncProfiler ASYNC_PROFILER = AsyncProfiler.getInstance(); |
There was a problem hiding this comment.
Please use lazy initialization as much as possible. I am not sure how much effects would this getInstance takes, but as service list is loaded before agent instrumentation, we should load as less code as possible. Otherwise, the instrumentation could fail due to classes have been loaded.
Sorry, something went wrong.
| private static final String SUCCESS_RESULT = "Profiling started\n"; | ||
|
|
||
| // profile executor thread pool, only running one thread | ||
| private static final ScheduledExecutorService ASYNC_PROFILER_EXECUTOR = Executors.newSingleThreadScheduledExecutor( |
There was a problem hiding this comment.
Same here, please initialize later in the process.
Sorry, something went wrong.
…/apm/agent/core/asyncprofiler/AsyncProfilerDataSender.java Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
…/apm/agent/core/asyncprofiler/AsyncProfilerTaskExecutionService.java Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
…/apm/agent/core/asyncprofiler/AsyncProfilerTaskExecutionService.java Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
| return; | ||
| } | ||
| final StatusRuntimeException statusRuntimeException = (StatusRuntimeException) t; | ||
| if (statusRuntimeException.getStatus().getCode() == Status.Code.UNIMPLEMENTED) { |
There was a problem hiding this comment.
Please use Status.Code.UNIMPLEMENTED.equals. It is safer.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Integrate async profiler performance analysis function in Java