File tree Expand file tree Collapse file tree 1 file changed +1
-5
lines changed
cli/src/main/java/net/laprun/sustainability/cli Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Original file line number Diff line number Diff line change 1818
1919package net .laprun .sustainability .cli ;
2020
21- import static net .laprun .sustainability .power .sensors .PowerSensor .EXTERNAL_CPU_SHARE_COMPONENT_NAME ;
22-
2321import java .time .Instant ;
2422import java .util .Optional ;
2523import java .util .concurrent .TimeUnit ;
@@ -136,12 +134,10 @@ public void run() {
136134 }
137135
138136 private Measure extractPowerConsumption (String applicationName , boolean useExternalCPUShare ) {
139- int cpuShareComponent = useExternalCPUShare ? measurer .metadata ().metadataFor (EXTERNAL_CPU_SHARE_COMPONENT_NAME ).index ()
140- : -1 ;
141137 final var appPower = measurer .persistence ()
142138 .synthesizeAndAggregateForSession (applicationName , session ,
143139 m -> {
144- double factor = useExternalCPUShare ? m .components [ cpuShareComponent ] : 1.0 ;
140+ double factor = useExternalCPUShare ? m .externalCPUShare : 1.0 ;
145141 return factor * totaler .computeTotalFrom (m .components );
146142 })
147143 .map (measure -> new Measure (measure , totaler .expectedResultUnit ()))
You can’t perform that action at this time.
0 commit comments