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
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
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.profile.GCProfiler;
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())
.addProfiler(GCProfiler.class)
.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 12275.329 ±
5132.424 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]