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

How to use JMX plugin #238

Open
stefanodoni opened this issue Mar 3, 2021 · 4 comments
Open

How to use JMX plugin #238

stefanodoni opened this issue Mar 3, 2021 · 4 comments
Assignees

Comments

@stefanodoni
Copy link

Hi,

I see that as part of the new release, it is possible to gather and report JMX metrics within the benchmark.

This can be very handy, however, I couldn't find any example about how to use them. I tried using the various command line options with no luck.

Could you kindly provide a working example?

Thank you!

@vhotspur
Copy link
Member

vhotspur commented Mar 4, 2021

Hello,

if you download the main JAR and the JMX plugin JAR from the 0.11.0 release, following command should work.

java \
    -jar renaissance-gpl-0.11.0.jar \
    --plugin 'plugin-jmxtimers-assembly-0.0.2.jar!org.renaissance.plugins.jmxtimers.Main' \
    --json data.json \
    --csv data.csv \
    scrabble

Then the CSV would contain something like this:

benchmark,duration_ns,jmx_timers_compilation_time_ms,jmx_timers_compilation_total_ms,uptime_ns,vm_start_unix_ms
scrabble,1585955295,2167,3430,1702712827,1614863148161
scrabble,952939770,8,3708,3456193364,1614863148161
scrabble,924849168,113,4070,4533845480,1614863148161
...

and in the JSON there would be the following fragment.

{
  "benchmarks": ["scrabble"],
  "format_version": 5,
  "data": {
    "scrabble": {
      "results": [{
        "duration_ns": 1585955295,
        "jmx_timers_compilation_time_ms": 2167,
        "jmx_timers_compilation_total_ms": 3430,
        "uptime_ns": 1702712827
      }, {
        "duration_ns": 952939770,
        "jmx_timers_compilation_time_ms": 8,
        "jmx_timers_compilation_total_ms": 3708,
        "uptime_ns": 3456193364
      },
 ...

And I see that we really do not have such example in README.md. I will add it there ASAP.

@vhotspur vhotspur self-assigned this Mar 4, 2021
@stefanodoni
Copy link
Author

stefanodoni commented Mar 4, 2021 via email

@vhotspur
Copy link
Member

vhotspur commented Mar 4, 2021

Is it possible to export other JMX metrics also?

At the moment, only java.lang.management.CompilationMXBean is used. But the plugin is extremely simple and it would be easy to create a different one collecting from other sources.

In which metrics would you be interested?

@stefanodoni
Copy link
Author

Memory and CPU usage for example

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

No branches or pull requests

2 participants