Skip to content
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

Added a new Profiler for CPU/JVM CPU monitoring using (Sun/Oracle) Java7+ JMX Bean #38

Merged
merged 4 commits into from Feb 19, 2016

Conversation

AlejandroRivera
Copy link
Contributor

While the current CPU profiler focuses on breakdowns per thread, this new profiler obtains CPU load (in percentage) for the entire JVM and the system.

Here's the description taken from the modified README file:

JVM And System CPU Profiler: JVMCPUProfiler

This profiler will record the JVM's and the overall system's CPU load, if the JVM is capable of providing this information.

Assuming you use the default prefix of statsd-jvm-profiler, the JVM CPU load metrics will be under statsd-jvm-profiler.cpu.jvm,
and the System CPU load wil be under statsd-jvm-profiler.cpu.system.

The reported metrics will be percentages in the range of [0, 100] with 1 decimal precision.

CPU load metrics are sampled and reported once every 10 seconds.

Important notes:

  • This Profiler is not enabled by default. To enable use the argument profilers=JVMCPUProfiler
  • This Profiler relies on Sun/Oracle-specific JVM implementations that offer a JMX bean that might not be available in other JVMs.
    Even if you are using the right JVM, there's no guarantee this JMX bean will remain there in the future.
  • The minimum required JVM version that offers support for this is for Java 7.
  • See com.sun.management.OperatingSystemMXBean
    for more information.
  • If the JVM doesn't support the required operations, the metrics above won't be reported at all.

@AlejandroRivera AlejandroRivera force-pushed the feature/cpu-monitoring branch 2 times, most recently from 343dc4e to 614244d Compare February 18, 2016 05:10
* <p>
* This profiler relies on a JMX bean that might not be available in all JVM implementations.
* We know for sure it's available in Sun/Oracle's JRE 7+, but there are no guarantees it
* will remain there for the foreseeable future.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it feasible to detect the presence of the bean and fail fast if it isn't present?

@ajsquared
Copy link
Contributor

Thanks, this is a really great new feature! I had a couple questions inline but overall this looks good.

@AlejandroRivera
Copy link
Contributor Author

How about now? :)

@ajsquared
Copy link
Contributor

Great, thanks for doing that renaming. This all looks good! I'll get 2.0 published this morning.

ajsquared added a commit that referenced this pull request Feb 19, 2016
Added a new Profiler for CPU/JVM CPU monitoring using (Sun/Oracle) Java7+ JMX Bean
@ajsquared ajsquared merged commit 72401f3 into etsy:master Feb 19, 2016
@ajsquared
Copy link
Contributor

I've just published 2.0.0. It should be available from Maven Central shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants