-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[HWKMETRICS-292] initial support for aggregating data across multiple…
… metrics This commit also includes a change to NumericDataPointCollector to facilitate testing. The order of input of values will effect the results of percentiles. This makes testing the new API difficult because we are fetching data points from multiple metrics concurrently which means the order of input is non-deterministic. The test hook allows for using a different implementation in which the order of inputs does not matter.
- Loading branch information
John Sanda
committed
Oct 2, 2015
1 parent
ae6d0db
commit e8c1531
Showing
9 changed files
with
340 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
core/metrics-core-impl/src/main/java/org/hawkular/metrics/core/impl/Percentile.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright 2014-2015 Red Hat, Inc. and/or its affiliates | ||
* and other contributors as indicated by the @author tags. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.hawkular.metrics.core.impl; | ||
|
||
/** | ||
* We use the org.apache.commons.math3.stat.descriptive.rank.PSquarePercentile class for computing percentiles. The | ||
* order in which values are added to PSquarePercentile can effect the results. This can make automated testing | ||
* difficult in scenarios in which values are added from different threads concurrently. For those scenarios | ||
* org.apache.commons.math3.stat.descriptive.rank.Percentile works better as it stores all values in memory and the | ||
* order in which it consumes values does not effect the result. Unfortunately, these two classes do not share a common | ||
* interface that we can use, so interface is used to facilitate testing. | ||
* | ||
* @author jsanda | ||
*/ | ||
public interface Percentile { | ||
|
||
void addValue(double value); | ||
|
||
double getResult(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Can we add support for a list of metric ids too? Not sure if we should do it one or the other; or obtain a list of metric based on both. But I see a use case where somebody wants to run this over a predefined list of metric ids.