[hawkular/hawkular-metrics] 26d303: HWKMETRICS-265 Counter "rate" returning same data ...
by Stefan Negrea
Branch: refs/heads/master
Home: https://github.com/hawkular/hawkular-metrics
Commit: 26d303d9fa18c4f39dc063930c4b15838f9494b2
https://github.com/hawkular/hawkular-metrics/commit/26d303d9fa18c4f39dc06...
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: 2015-09-25 (Fri, 25 Sep 2015)
Changed paths:
M core/metrics-core-impl/src/main/java/org/hawkular/metrics/core/impl/MetricsServiceImpl.java
M core/metrics-core-impl/src/test/java/org/hawkular/metrics/core/impl/MetricsServiceITest.java
M integration-tests/rest-tests-jaxrs/src/test/groovy/org/hawkular/metrics/rest/CountersITest.groovy
Log Message:
-----------
HWKMETRICS-265 Counter "rate" returning same data as "data" endpoint
In the previous implementation, we used to:
- sort out counter data points in one minute buckets
- compute rate based on low and high value
The implementation had the following issues:
- if there's just one point per minute in the original counter, you get a rate metric similar to the original counter metric
- if there's less that one point per minute you get a rate metric with many "NaN" values
The new implementation has a basic approach:
- buffer counter data observable into "previous/next" pairs
- compute rate for each pair, where timestamp is the average counter points of the timestamps
Let's take an example. Consider the following counter data points:
{"timestamp":0,"value":0}
{"timestamp":30000,"value":50}
{"timestamp":60000,"value":80}
The computed rate data points would be:
{"timestamp":15000,"value":100.0}
{"timestamp":45000,"value":60.0}
Commit: 61223a6f7cede1d51647292c7951dec0e3587c6e
https://github.com/hawkular/hawkular-metrics/commit/61223a6f7cede1d516472...
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: 2015-09-25 (Fri, 25 Sep 2015)
Changed paths:
M core/metrics-core-impl/src/main/java/org/hawkular/metrics/core/impl/MetricsServiceImpl.java
M core/metrics-core-impl/src/test/java/org/hawkular/metrics/core/impl/MetricsServiceITest.java
M integration-tests/rest-tests-jaxrs/src/test/groovy/org/hawkular/metrics/rest/CountersITest.groovy
Log Message:
-----------
Merge pull request #368 from tsegismont/jira/HWKMETRICS-265
HWKMETRICS-265 Counter "rate" returning same data as "data" endpoint
Compare: https://github.com/hawkular/hawkular-metrics/compare/590c9a8477ec...61223...
10 years, 6 months