jmxtrans / jmxtrans-agent

Java Agent based JMX metrics exporter.
MIT License
178 stars 110 forks source link

Support for overriding the collect interval for individual queries and invocations #67

Closed kerlandsson closed 8 years ago

kerlandsson commented 8 years ago

Support for setting collectIntervalInSeconds as an attribute on queries and invocations. Overrides the default setting. For example:

<query objectName="java.lang:type=Threading" attributes="ThreadCount,TotalStartedThreadCount"
   resultAlias="jvm.threads.#attribute#" collectIntervalInSeconds="5"/>

Implementation details: Collections are still made in a single thread. The thread is scheduled to run at an interval that is equal to the greatest common divisor of the actual collect intervals. On each run, each query/invocation is checked to see if it is time to run that specific query/invocation. The time at which it was last run is remembered to decide when to run next.

See issue #56

cyrille-leclerc commented 8 years ago

Thanks @kerlandsson !