From 7c3c3a1d86782a515583f89c6f17fb30e7f5e41e Mon Sep 17 00:00:00 2001 From: Yaman Ziadeh Date: Tue, 15 Jul 2025 16:13:18 -0400 Subject: [PATCH] Initial async-profiler Nodetool implementation patch by Yaman Ziadeh, Bernardo Botella, Stefan Miklosovic; reviewed by Dmitry Konstantinov, Jyothsna Konisa for CASSANDRA-20854 --- .build/cassandra-deps-maven-pom.xml | 4 + .build/parent-maven-pom.xml | 6 + CHANGES.txt | 1 + NEWS.txt | 1 + conf/jvm-server.options | 7 + doc/modules/cassandra/nav.adoc | 1 + .../managing/operating/async-profiler.adoc | 141 +++++ .../config/CassandraRelevantProperties.java | 2 + .../profiler/AsyncProfilerMBean.java | 107 ++++ .../service/AsyncProfilerService.java | 538 ++++++++++++++++++ .../cassandra/service/CassandraDaemon.java | 2 + .../cassandra/service/StartupChecks.java | 63 ++ .../cassandra/service/StorageService.java | 11 + .../org/apache/cassandra/tools/NodeProbe.java | 11 + .../nodetool/AsyncProfileCommandGroup.java | 264 +++++++++ .../tools/nodetool/NodetoolCommand.java | 1 + .../mock/nodetool/InternalNodeProbe.java | 2 + .../distributed/test/AsyncProfilerTest.java | 198 +++++++ test/resources/nodetool/help/nodetool | 1 + test/resources/nodetool/help/profile | 102 ++++ test/resources/nodetool/help/profile$execute | 38 ++ test/resources/nodetool/help/profile$fetch | 40 ++ test/resources/nodetool/help/profile$list | 27 + test/resources/nodetool/help/profile$purge | 27 + test/resources/nodetool/help/profile$start | 48 ++ test/resources/nodetool/help/profile$status | 27 + test/resources/nodetool/help/profile$stop | 32 ++ .../service/AsyncProfilerServiceTest.java | 315 ++++++++++ 28 files changed, 2017 insertions(+) create mode 100644 doc/modules/cassandra/pages/managing/operating/async-profiler.adoc create mode 100644 src/java/org/apache/cassandra/profiler/AsyncProfilerMBean.java create mode 100644 src/java/org/apache/cassandra/service/AsyncProfilerService.java create mode 100644 src/java/org/apache/cassandra/tools/nodetool/AsyncProfileCommandGroup.java create mode 100644 test/distributed/org/apache/cassandra/distributed/test/AsyncProfilerTest.java create mode 100644 test/resources/nodetool/help/profile create mode 100644 test/resources/nodetool/help/profile$execute create mode 100644 test/resources/nodetool/help/profile$fetch create mode 100644 test/resources/nodetool/help/profile$list create mode 100644 test/resources/nodetool/help/profile$purge create mode 100644 test/resources/nodetool/help/profile$start create mode 100644 test/resources/nodetool/help/profile$status create mode 100644 test/resources/nodetool/help/profile$stop create mode 100644 test/unit/org/apache/cassandra/service/AsyncProfilerServiceTest.java diff --git a/.build/cassandra-deps-maven-pom.xml b/.build/cassandra-deps-maven-pom.xml index 4402a8efd9..474c1037d0 100644 --- a/.build/cassandra-deps-maven-pom.xml +++ b/.build/cassandra-deps-maven-pom.xml @@ -161,6 +161,10 @@ com.github.jbellis jamm + + tools.profiler + async-profiler + io.netty netty-all diff --git a/.build/parent-maven-pom.xml b/.build/parent-maven-pom.xml index 5d6ca01a4c..c75e254533 100644 --- a/.build/parent-maven-pom.xml +++ b/.build/parent-maven-pom.xml @@ -40,6 +40,7 @@ 4.0.20 4.1.130.Final 0.5.1 + 4.2 @asm.version@ @@ -465,6 +466,11 @@ jamm ${jamm.version} + + tools.profiler + async-profiler + ${async-profiler.version} +