Skip to content

Commit 6d04758

Browse files
committed
feat: output as measure with unit
1 parent 3c171e5 commit 6d04758

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

measure/src/main/java/net/laprun/sustainability/power/analysis/total/TotalSyntheticComponent.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package net.laprun.sustainability.power.analysis.total;
22

3+
import net.laprun.sustainability.power.Measure;
34
import net.laprun.sustainability.power.SensorMetadata;
45
import net.laprun.sustainability.power.SensorUnit;
56
import net.laprun.sustainability.power.analysis.SyntheticComponent;
@@ -32,4 +33,8 @@ public SensorMetadata.ComponentMetadata metadata() {
3233
public double synthesizeFrom(double[] components, long timestamp) {
3334
return totaler.computeTotalFrom(components);
3435
}
36+
37+
public Measure asMeasure(double[] components) {
38+
return new Measure(synthesizeFrom(components, 0L), metadata.unit());
39+
}
3540
}

0 commit comments

Comments
 (0)