Switch-vov commented on a change in pull request #52:
URL: 
https://github.com/apache/skywalking-data-collect-protocol/pull/52#discussion_r662970686



##########
File path: language-agent/JVMMetric.proto
##########
@@ -85,8 +86,22 @@ enum GCPhrase {
 }
 
 message Thread {
-  int64 liveCount = 1;
-  int64 daemonCount = 2;
-  int64 peakCount = 3;
+    int64 liveCount = 1;
+    int64 daemonCount = 2;
+    int64 peakCount = 3;
+    int64 deadlockedCount = 4;
+    int64 monitorDeadlockedCount = 5;
+    int64 newStateThreadCount = 6;
+    int64 runnableStateThreadCount = 7;
+    int64 blockedStateThreadCount = 8;
+    int64 waitingStateThreadCount = 9;
+    int64 timedWaitingStateThreadCount = 10;
+    int64 terminatedStateThreadCount = 11;

Review comment:
       ## ThreadProviderBenchmark
   
   ```java
   package org.apache.skywalking.apm.agent.core.jvm.thread;
   
   import org.openjdk.jmh.annotations.Benchmark;
   import org.openjdk.jmh.annotations.BenchmarkMode;
   import org.openjdk.jmh.annotations.Fork;
   import org.openjdk.jmh.annotations.Mode;
   import org.openjdk.jmh.annotations.OutputTimeUnit;
   import org.openjdk.jmh.runner.Runner;
   import org.openjdk.jmh.runner.options.Options;
   import org.openjdk.jmh.runner.options.OptionsBuilder;
   
   import java.util.concurrent.TimeUnit;
   
   public class ThreadProviderBenchmark {
   
       @Benchmark
       @Fork(value = 1, warmups = 1)
       @OutputTimeUnit(TimeUnit.SECONDS)
       @BenchmarkMode(Mode.Throughput)
       public void getThreadMetrics() {
           ThreadProvider.INSTANCE.getThreadMetrics();
       }
   
       public static void main(String[] args) throws Exception {
           Options opt = new 
OptionsBuilder().include(ThreadProviderBenchmark.class.getSimpleName())
                   .build();
           new Runner(opt).run();
       }
   
       /**
        * # JMH version: 1.21
        * # VM version: JDK 1.8.0_231, Java HotSpot(TM) 64-Bit Server VM, 
25.231-b11
        * # VM invoker: 
/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/bin/java
        * # VM options: -javaagent:/Users/switch/Library/Application 
Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/211.7442.40/IntelliJ 
IDEA.app/Contents/lib/idea_rt.jar=65029:/Users/switch/Library/Application 
Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/211.7442.40/IntelliJ 
IDEA.app/Contents/bin -Dfile.encoding=UTF-8
        * # Warmup: 5 iterations, 10 s each
        * # Measurement: 5 iterations, 10 s each
        * # Timeout: 10 min per iteration
        * # Threads: 1 thread, will synchronize iterations
        * # Benchmark mode: Throughput, ops/time
        * 
        * Benchmark                                  Mode  Cnt      Score      
Error  Units
        * ThreadProviderBenchmark.getThreadMetrics  thrpt    5  14948.924 ± 
1942.711  ops/s
        */
   }
   ```




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to