Skip to content
forked from phax/profiler

Port of Twitter's Scala JVM-profiler to Java

License

Notifications You must be signed in to change notification settings

lp2jx0309/profiler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 project's CpuProfile and related classes.

Original Scala sources:

Usage

The CpuProfile.record method will record samples of stacktrace elements and return a CpuProfile object. That object can then be written into a pprof-parseable format using CpuProfile.writeGoogleProfile.

There is a provided JAX-RS resource that makes this simple to use with an http service. For example, with a Dropwizard application:

environment.jersey().register(CpuProfileResource.class);

Which exposes the URLs /pprof/contention that detects blocked threads, and /pprof/profile that detects runnable threads. Here is an example of using curl to retrieve a profile and turn it into a PDF:

curl http://localhost:8181/pprof/contention > prof
pprof --pdf prof > profile.pdf

Maven usage

<dependency>
  <groupId>com.helger</groupId>
  <artifactId>profiler</artifactId>
  <version>1.1.1</version>
</dependency>

About

Port of Twitter's Scala JVM-profiler to Java

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%