Skip to content

Commit

Permalink
Move thread dump tools to separate module
Browse files Browse the repository at this point in the history
  • Loading branch information
aragozin committed Feb 16, 2015
1 parent 9c38f07 commit fb2cb1d
Show file tree
Hide file tree
Showing 19 changed files with 287 additions and 138 deletions.
267 changes: 134 additions & 133 deletions pom.xml
@@ -1,133 +1,134 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<!--
Copyright 2012 Alexey Ragozin
Licensed 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.
-->

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.gridkit.lab</groupId>
<artifactId>grid-lab-pom</artifactId>
<version>2</version>
</parent>

<groupId>org.gridkit.jvmtool</groupId>
<artifactId>jvmtool-umbrella-pom</artifactId>
<version>0.3.4-SNAPSHOT</version>
<name>${project.groupId}::${project.artifactId}</name>
<description>JVM tools, parent project</description>
<packaging>pom</packaging>

<modules>
<module>sjk-core</module>
<module>mxdump</module>
<module>gcflow</module>
<module>sjk</module>
<module>sjk-lite</module>
<module>sjk-plus</module>
<module>hprof-heap</module>
<module>ygc-bench</module>
</modules>

<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>

<developers>
<developer>
<id>alexey.ragozin</id>
<name>Alexey Ragozin</name>
<email>alexey.ragozin@gmail.com</email>
</developer>
</developers>

<scm>
<connection>scm:git:https://github.com/aragozin/jvm-tools.git</connection>
<developerConnection>scm:git:https://github.com/aragozin/jvm-tools.git</developerConnection>
<url>https://github.com/aragozin/jvm-tools</url>
<tag>HEAD</tag>
</scm>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.4</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<pushChanges>true</pushChanges>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.14</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
<executions>
<execution>
<id>attach-javadoc</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-source</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<!--
Copyright 2012 Alexey Ragozin
Licensed 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.
-->

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.gridkit.lab</groupId>
<artifactId>grid-lab-pom</artifactId>
<version>2</version>
</parent>

<groupId>org.gridkit.jvmtool</groupId>
<artifactId>jvmtool-umbrella-pom</artifactId>
<version>0.3.4-SNAPSHOT</version>
<name>${project.groupId}::${project.artifactId}</name>
<description>JVM tools, parent project</description>
<packaging>pom</packaging>

<modules>
<module>sjk-stacktrace</module>
<module>sjk-core</module>
<module>mxdump</module>
<module>gcflow</module>
<module>sjk</module>
<module>sjk-lite</module>
<module>sjk-plus</module>
<module>hprof-heap</module>
<module>ygc-bench</module>
</modules>

<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>

<developers>
<developer>
<id>alexey.ragozin</id>
<name>Alexey Ragozin</name>
<email>alexey.ragozin@gmail.com</email>
</developer>
</developers>

<scm>
<connection>scm:git:https://github.com/aragozin/jvm-tools.git</connection>
<developerConnection>scm:git:https://github.com/aragozin/jvm-tools.git</developerConnection>
<url>https://github.com/aragozin/jvm-tools</url>
<tag>HEAD</tag>
</scm>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.4</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<pushChanges>true</pushChanges>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.14</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
<executions>
<execution>
<id>attach-javadoc</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-source</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
5 changes: 5 additions & 0 deletions sjk-core/pom.xml
Expand Up @@ -32,6 +32,11 @@
<description>Core classes for Swiss Java Knife tool</description>

<dependencies>
<dependency>
<groupId>org.gridkit.jvmtool</groupId>
<artifactId>sjk-stacktrace</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.gridkit.lab</groupId>
<artifactId>jvm-attach-api</artifactId>
Expand Down
61 changes: 61 additions & 0 deletions sjk-stacktrace/pom.xml
@@ -0,0 +1,61 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<!--
Copyright 2012 Alexey Ragozin
Licensed 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.
-->

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.gridkit.jvmtool</groupId>
<artifactId>jvmtool-umbrella-pom</artifactId>
<version>0.3.4-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>sjk-stacktrace</artifactId>
<name>${project.groupId}::${project.artifactId}</name>
<description>Thread dumps: capture and encoding</description>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.carrotsearch</groupId>
<artifactId>junit-benchmarks</artifactId>
<version>0.7.2</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Expand Up @@ -162,7 +162,7 @@ else if (index == mn) {
return fileName.charAt(index - mn);
case NO_SOURCE:
try {
return UNKNOWN_SOURCE.charAt(index - mn);
return UNKNOWN_SOURCE.charAt(index - mn);
}
catch ( StringIndexOutOfBoundsException e) {
throw e;
Expand Down
Expand Up @@ -266,9 +266,9 @@ private static class GenericMBeanThreadCounter implements CounterCollector {
public GenericMBeanThreadCounter(ThreadMXBean bean, CounterType counter) {
this.slowBean = bean;
try {
if (bean instanceof com.sun.management.ThreadMXBean) {
fastBean = (com.sun.management.ThreadMXBean) bean;
}
if (bean instanceof com.sun.management.ThreadMXBean) {
fastBean = (com.sun.management.ThreadMXBean) bean;
}
}
catch(NoClassDefFoundError e) {
// ignore
Expand Down

0 comments on commit fb2cb1d

Please sign in to comment.