CounterMonitors with offset and modulus
Jeremy Boynes <[email protected]>
| Newsgroups | gmane.comp.java.mx4j.devel |
|---|---|
| Message-ID | <[email protected]> |
Can someone please clarify the operation of CounterMonitors for me when they have offset, threshold and modulus? I have a counter with an initThreshold of 1, an offset of 1 and a modulus of 5, running in counter mode (not differencing). Over time it has reached a state where the current value is 4 and the threshhold has bumped to 5. If I then set the observed attribute to the value 5, a notification is generated (cool) and in JDK1.5 the threshold is raised to 6. If I then set it to 6, I get another value and the threshold is raised to 7. How can the value of the threshold be greater than the modulus? I would have expected it to be reset to the initial value 1 (which is what MX4J does) as the spec says "The threshold will then also “roll over” whenever it strictly exceeds the modulus value." Are we meant to detect counter "roll-over" by looking for a decrease in value and only apply the modulus then (although I couldn't see anyhting about that in the spec)? Thanks -- Jeremy ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95&alloc_id396&op=click