AnsweredAssumed Answered

monitoring of custom mbeans

Question asked by JohnGregg on Aug 19, 2010
Latest reply on Aug 31, 2010 by JayFielding
Hi All,

I would like to create some custom mbeans for my app and monitor them with Wily. I will be monitoring things like counts, execution times, etc. In order to get Wily to display the values for some interval, would the getter methods in my mbeans need to also clear the metrics? I'm assuming that if they don't, then Wily will just record and display the cumulative value. That is, at 13:42:15, it will show n, at 13:42:30 it will show n + delta, etc. I would prefer that it show the delta during a given interval. Is there a way to do this other than making the getter reset stats?

Example:
class Foo implements FooMBean {

private int invocations = 0;

public int getInvocations() {
  int temp = invocations;
  invocations = 0;
  return temp;
}
}
thanks

Outcomes