-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ComponentMeasure -> Analyzer for data analysis instead of measure
- Loading branch information
Showing
8 changed files
with
52 additions
and
56 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
measure/src/main/java/net/laprun/sustainability/power/measure/Analyzer.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,5 @@ | ||
package net.laprun.sustainability.power.measure; | ||
|
||
public interface Analyzer { | ||
void recordComponentValue(double value, long timestamp); | ||
} |
11 changes: 0 additions & 11 deletions
11
measure/src/main/java/net/laprun/sustainability/power/measure/ComponentMeasure.java
This file was deleted.
Oops, something went wrong.
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
20 changes: 20 additions & 0 deletions
20
measure/src/main/java/net/laprun/sustainability/power/measure/HdrHistogramAnalyzer.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,20 @@ | ||
package net.laprun.sustainability.power.measure; | ||
|
||
import org.HdrHistogram.IntCountsHistogram; | ||
|
||
@SuppressWarnings("unused") | ||
public class HdrHistogramAnalyzer implements Analyzer { | ||
private static final int HIGHEST_TRACKABLE_VALUE = 1_000_000; | ||
private static final int NUMBER_OF_SIGNIFICANT_VALUE_DIGITS = 4; | ||
private static final int CONVERSION_FACTOR = 1000; | ||
private final IntCountsHistogram histogram; | ||
|
||
public HdrHistogramAnalyzer() { | ||
histogram = new IntCountsHistogram(HIGHEST_TRACKABLE_VALUE, NUMBER_OF_SIGNIFICANT_VALUE_DIGITS); | ||
} | ||
|
||
@Override | ||
public void recordComponentValue(double value, long timestamp) { | ||
histogram.recordValue((long) (CONVERSION_FACTOR * value)); | ||
} | ||
} |
35 changes: 0 additions & 35 deletions
35
...e/src/main/java/net/laprun/sustainability/power/measure/HdrHistogramComponentMeasure.java
This file was deleted.
Oops, something went wrong.
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