JDK-6683213 : CounterMonitor's derived Gauge badly initialized
  • Type: Bug
  • Component: core-svc
  • Sub-Component: javax.management
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2008-04-02
  • Updated: 2012-03-22
  • Resolved: 2009-01-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
6u12 b02Fixed 7Fixed
In the JMX 1.4 Specification, PDF document, paragraph 9.3, we read:
"The derived gauge value (V[t]) for the counter difference is calculated at time t
using the following algorithm, where GP is the granularity period:
    While t is less than StartDate+2GP, V[t] = (Integer)0"

The issue is that the derived Gauge value is null when is less than StartDate+2GP with JDK 6.
Because of that, a CounterNotification is potentially not emitted as it should.
This is a regression compared to JDK 5.
Attached output of a test run once over JDK 6 U5 b13 and once over JDK 5 U15 b08.
That test uses a threshold set to 2, a modulus set to 7, uses difference mode. We set the observed object to 0, 1, 2, 7. Granularity period is 500 ms and setAttribute calls are done every second.
The correct set of JCK tests hit by this defect is MonitorTest tests numbered 4, 5, 6, 13 and 20.
The tests numbered 1, 3, 32 and 33 do not use the difference mode then they've no chance to be hit by a wrong derived gauge computation.

EVALUATION The spec is right and the implementation needs to be changed to follow the spec.