Skip to content
papertrailPublic

About

Port of Twitter's Scala JVM-profiler to Java

Resources

Stars

15 stars

Watchers

15 watching

Forks

Latest commit

 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Port of Twitter's Scala JVM-profiler to Java

Resources

Stars

15 stars

Watchers

15 watching

Forks

Releases

Packages

Used by

Contributors

Languages