In Double org.rhq.plugins.jbossas5.WebApplicationContextComponent.getServletMetric(ManagementView managementView, String metricName) throws Exception[1] the metrics averageResponseTime[2], minimumResponseTime[3], and maximumResponseTime[4] are calculated. In some circumstances though, their value is set to Double.NaN. I am assuming this is because there is no data for this period? If this assumption is correct, wouldn't 0 have the same meaning?
[1]: http://git.fedorahosted.org/git?p=rhq/rhq.git;a=blob;f=modules/plugins/jboss... [2]: http://git.fedorahosted.org/git?p=rhq/rhq.git;a=blob;f=modules/plugins/jboss... [3]: http://git.fedorahosted.org/git?p=rhq/rhq.git;a=blob;f=modules/plugins/jboss... [4]: http://git.fedorahosted.org/git?p=rhq/rhq.git;a=blob;f=modules/plugins/jboss...
There are three ways a plugin can indicate in its MeasurementFacet.getValues() impl that there's no data currently available for a requested metric:
1) set the data value to null (measurementDataNumeric.setValue(null))
2) set the data value to Double.NaN (measurementDataNumeric.setValue(Double.NaN))
3) for that metric, do not add a measurementDataNumeric to the MeasurementReport
I personally prefer 3), but we have plugins that use each of the different ways, so we pretty much have to continue to support all three. I'll update the Javadoc of MeasurementFacet.getValues() to actually document this info.
Here's the snippet from MeasurementDataManagerBean.addNumericData() in server-jar that implements 1) and 2):
for (MeasurementDataNumeric aData : data) { if (aData.getValue() == null || Double.isNaN(aData.getValue())) { expectedCount--; continue; } ...
On 11/09/2011 07:09 PM, Larry O'Leary wrote:
In Double org.rhq.plugins.jbossas5.WebApplicationContextComponent.getServletMetric(ManagementView managementView, String metricName) throws Exception[1] the metrics averageResponseTime[2], minimumResponseTime[3], and maximumResponseTime[4] are calculated. In some circumstances though, their value is set to Double.NaN. I am assuming this is because there is no data for this period? If this assumption is correct, wouldn't 0 have the same meaning?
rhq-devel@lists.fedorahosted.org