kezhenxu94 commented on a change in pull request #4220: sniffer processing 
profile task and report status and snapshot
URL: https://github.com/apache/skywalking/pull/4220#discussion_r368213672
 
 

 ##########
 File path: 
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/profile/ProfileTaskExecutionService.java
 ##########
 @@ -84,19 +90,46 @@ public void run() {
         }, timeToProcessMills, TimeUnit.MILLISECONDS);
     }
 
+    /**
+     * check and add {@link TracingContext} profiling
+     */
+    public boolean addProfiling(TracingContext tracingContext, ID 
traceSegmentId, String firstSpanOPName) {
+        // get current profiling task, check need profiling
+        final ProfileTaskExecutionContext executionContext = 
taskExecutionContext.get();
+        if (executionContext == null) {
+            return false;
+        }
+
+        return executionContext.attemptProfiling(tracingContext, 
traceSegmentId, firstSpanOPName);
+    }
+
+    /**
+     * Re-check current trace need profiling, encase third part plugin change 
the operation name.
 
 Review comment:
   ```suggestion
        * Re-check current trace need profiling, in case that third-party 
plugins change the operation name.
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to