Bug 1091072
| Summary: | Group metrics with no metrics in Cassandra can result in averages that are NaN or contain partial results | ||
|---|---|---|---|
| Product: | [Other] RHQ Project | Reporter: | Elias Ross <genman> |
| Component: | Monitoring | Assignee: | Nobody <nobody> |
| Status: | NEW --- | QA Contact: | |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 4.9 | CC: | hrupp |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | Type: | Bug | |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
The other question is if NaN should be excluded from baselines and aggregation calculation might be settled in a separate bug. The real issue seems to come from pagination not working correctly.
(Still I wonder if NaN handling is correct...)
diff --git a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/domain/ListPagedResult.java b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/domai
index f3abd20..2e929c5 100644
--- a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/domain/ListPagedResult.java
+++ b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/domain/ListPagedResult.java
@@ -74,7 +74,7 @@ private ResultSet retrieveNextResultSet(ResultSet existingResultSet, List<Intege
while ((existingResultSet == null || existingResultSet.isExhausted()) && ids.size() != 0) {
BoundStatement boundStatement = this.preparedStatement.bind(ids.remove(0), new Date(startTime),
new Date(endTime));
- return session.execute(boundStatement);
+ existingResultSet = session.execute(boundStatement);
}
} catch (NoHostAvailableException e) {
throw new CQLException(e);
|
Description of problem: If a group only has some resources reporting values, the result is NaN for the entire group. The use case is: I have a number of servers calculating a count of bad requests. about 80% return results, the remaining 20% do not have this calculation feature yet. The average should not 'count' 20% of those servers, since they have nothing to report. So I would expect the average to 'skip' NaN values. This happens for the following methods: MetricsServer { public AggregateNumericMetric getSummaryAggregate(List<Integer> scheduleIds, long beginTime, long endTime) { This is one possible solution, although it may make sense to 'fix' ArithmeticMeanCalculator to ignore NaN entirely. diff --git a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java b/modules/enterprise/server/server-metrics/src/m index e9f774f..813f451 100644 --- a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java +++ b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java @@ -607,6 +607,10 @@ private AggregateNumericMetric calculateAggregatedRaw(Iterable<RawNumericMetric> for (RawNumericMetric metric : rawMetrics) { value = metric.getValue(); + if (value == Double.NaN) { + // count these values? + continue; + } if (count == 0) { min = value; max = min; It is used in these classes: MetricsBaselineCalculator -- If some NaN values exist, the baseline should probably just be from the extant values. MetricsServer.calculateAggregate -- ??? Compute1HourData -- etc. ??? Version-Release number of selected component (if applicable): 4.9 How reproducible: Always Steps to Reproduce: 1. Create a group of resources 2. Some resources return values 3. Others do not Actual results: NaN reported for entire group Expected results: Average Additional info: