Skip to content

Add a thread dump and cluster dump tool #1296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions client-runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,23 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<excludeGroupIds>org.terracotta</excludeGroupIds>
<excludeScope>provided</excludeScope>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
32 changes: 32 additions & 0 deletions client-runtime/src/main/java/com/tc/cmdline/Probe.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template
*/
package com.tc.cmdline;

import java.net.InetSocketAddress;
import java.util.Properties;
import org.terracotta.connection.ConnectionException;
import org.terracotta.connection.DiagnosticsFactory;

/**
*
* @author mscott2
*/
public class Probe {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
String[] hp = args[0].split("[:]");
InetSocketAddress inet = InetSocketAddress.createUnresolved(hp[0], Integer.parseInt(hp[1]));
try (com.terracotta.diagnostic.Diagnostics d = (com.terracotta.diagnostic.Diagnostics)DiagnosticsFactory.connect(inet, new Properties())) {
System.out.println(d.getThreadDump());
System.out.println(d.getClusterState());
} catch (ConnectionException e) {
e.printStackTrace();
}
}

}
2 changes: 2 additions & 0 deletions client-runtime/src/main/resources/example.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
java -cp target/client-runtime-5.8.5.jar:target/dependency/* com.tc.cmdline.Probe $1