Skip to content
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
target/
/.settings/
/.classpath
/.project
25 changes: 22 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
This is a fork of https://github.com/papertrail/profiler/ version 1.0.3-SNAPSHOT

* Requires Java 8 and therefore no dependency on joda-time anymore (since v1.1.0)
* Now as OSGI bundle (since v1.1.1)

It's meant to be a simple replacement using the same package name as the original (just with the Java 8 `Duration` type)

Original sources Copyright 2015 Papertrail, Inc.

# JVM cpu profiler

A pure-java implementation of the [twitter/util](https://github.com/twitter/util) project's `CpuProfile` and related
classes.
classes.

Original Scala sources:

* [CpuProfile.scala](https://github.com/twitter/util/blob/develop/util-jvm/src/main/scala/com/twitter/jvm/CpuProfile.scala)
* [CpuProfileTest.scala](https://github.com/twitter/util/blob/develop/util-jvm/src/test/scala/com/twitter/jvm/CpuProfileTest.scala)

## Usage

The `CpuProfile.record` method will record samples of stacktrace elements and return a `CpuProfile` object. That object
Expand All @@ -27,4 +36,14 @@ threads. Here is an example of using `curl` to retrieve a profile and turn it in
```bash
curl http://localhost:8181/pprof/contention > prof
pprof --pdf prof > profile.pdf
```
```

## Maven usage

```xml
<dependency>
<groupId>com.helger</groupId>
<artifactId>profiler</artifactId>
<version>1.1.1</version>
</dependency>
```
131 changes: 39 additions & 92 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,129 +1,76 @@
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.helger</groupId>
<artifactId>parent-pom</artifactId>
<version>1.10.9</version>
</parent>

<groupId>com.papertrail</groupId>
<artifactId>profiler</artifactId>
<version>1.0.3-SNAPSHOT</version>
<packaging>jar</packaging>

<version>1.1.2-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>${project.groupId}:${project.artifactId}</name>
<description>A pure-java implementation of the twitter/util project's `CpuProfile` and related classes.</description>
<url>https://github.com/papertrail/profiler</url>
<url>https://github.com/phax/profiler</url>

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

<developers>
<developer>
<name>Jared Harper</name>
<email>jared@librato.com</email>
<organization>Papertrail, Inc.</organization>
<organizationUrl>http://www.papertrailapp.com</organizationUrl>
</developer>
<developer>
<id>philip</id>
<name>Philip Helger</name>
<email>ph(at)helger.com</email>
<url>http://www.helger.com</url>
</developer>
</developers>

<scm>
<connection>scm:git:git@github.com:papertrail/profiler.git</connection>
<developerConnection>scm:git:git@github.com:papertrail/profiler.git</developerConnection>
<url>git@github.com:papertrail/profiler.git</url>
<connection>scm:git:git@github.com:phax/profiler.git</connection>
<developerConnection>scm:git:git@github.com:phax/profiler.git</developerConnection>
<url>git@github.com:phax/profiler.git</url>
<tag>HEAD</tag>
</scm>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<profiles>
<profile>
<id>release-sign-artifacts</id>
<activation>
<property>
<name>gpg.passphrase</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.9.1</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0.1</version>
<version>2.1.1</version>
<scope>provided</scope>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Automatic-Module-Name>com.papertrail.profiler</Automatic-Module-Name>
<Export-Package>com.papertrail.profiler.*</Export-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>
Loading