You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2018/11/07 10:19:29 UTC

[GitHub] psy-core opened a new issue #1889: Is it possible to use multithreading in this place?

psy-core opened a new issue #1889: Is it possible to use multithreading in this place?
URL: https://github.com/apache/incubator-skywalking/issues/1889
 
 
   https://github.com/apache/incubator-skywalking/blob/03824c2f8f43d55746ac466f0252bd78c1b48363/apm-collector/apm-collector-agent-stream/collector-agent-stream-provider/src/main/java/org/skywalking/apm/collector/agent/stream/worker/trace/TraceSegmentService.java#L37-L40
   
   
   I'm trying to improve the processing speed for apm collector in skywalking version `3.2.6`.  Is it possible to run `send` method in a thread pool rather than invoke it directly? just like this:
   
   ```
   private final ThreadPoolExecutor executor;
   ...
   public void send(UpstreamSegment segment) {
       executor.execute(new TraceSegmentRunnable(moduleManager, segment));
   }
   ...
   
   public class TraceSegmentRunnable implements Runnable {
   
       private final ModuleManager moduleManager;
       UpstreamSegment segment;
       ....
       public void run() {
           SegmentParse segmentParse = new SegmentParse(moduleManager);
           segmentParse.parse(segment, SegmentParse.Source.Agent);
       }
   }
   ``` 
   
   Is there any problem or risk?
   
   
   

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


With regards,
Apache Git Services