martint / jmxutils

Exporting JMX mbeans made easy
Apache License 2.0
171 stars 47 forks source link

Custom ManagedAnnotation ? #18

Closed johngmyers closed 11 years ago

johngmyers commented 11 years ago

We're looking at feeding some of our instrumentation into a time series database, in addition to exposing it through JMX.

We'll want some of our stats objects to maintain two sets of data: one using decaying values for JMX, another using minute buckets for the time series database. So we'd have @Managed for JMX only, a custom @Report (which would be @ManagedAnnotation) for both JMX and database, and a custom @ReportOnly (which would not be @ManagedAnnotation) for database only.

So, to implement this, would it make sense for jmxutils to support custom replacements for @ManagedAnnotation? For example, add a constructor:

public MBeanExporter(MBeanServer server)
{
    this(server, ManagedAnnotation.class);
}

public MBeanExporter(MBeanServer server, 
                     Class<? extends Annotation> managementAnnotation)

Then I could define a custom ManagedAnnotation and use jmxutils to populate a MBeanServer that feeds the time series database.

I'm willing to do the coding, but I'd first like your take on the idea.

johngmyers commented 11 years ago

It turns out my use case requires far more extensive changes than are reasonable to incorporate into jmxutils, so I'm closing this out.