@@ -14,11 +14,11 @@ import (
1414)
1515
1616type MedianAggregatorConfig struct {
17- DeviceType string `json:"deviceType"`
17+ DeviceType string `json:"deviceType"`
1818 BasePower float64 `json:"basePower"`
19- PowerMetric string `json:"powerMetric"`
20- PerformanceMetric string `json:"performanceMetric"`
21- UseMax bool `json:"useMax"`
19+ PowerMetric string `json:"powerMetric"`
20+ PerformanceMetric string `json:"performanceMetric"`
21+ UseMax bool `json:"useMax"`
2222}
2323
2424type MedianDeviceState struct {
@@ -30,12 +30,12 @@ type MedianDeviceState struct {
3030
3131type MedianAggregator struct {
3232 // map[hostname]map[deviceId]MedianDeviceState
33- devices map [string ]map [string ]* MedianDeviceState
34- powerMetric string
35- performanceMetric string
36- deviceType string
37- basePower float64
38- useMax bool
33+ devices map [string ]map [string ]* MedianDeviceState
34+ powerMetric string
35+ performanceMetric string
36+ deviceType string
37+ basePower float64
38+ useMax bool
3939}
4040
4141func NewMedianAggregator (rawConfig json.RawMessage ) (* MedianAggregator , error ) {
@@ -69,7 +69,6 @@ func (a *MedianAggregator) AggregateMetric(m lp.CCMessage) {
6969 return
7070 }
7171
72-
7372 var deviceState * MedianDeviceState
7473 if m .Name () == a .powerMetric || m .Name () == a .performanceMetric {
7574 devicesOfHostState , ok := a .devices [hostname ]
@@ -81,7 +80,7 @@ func (a *MedianAggregator) AggregateMetric(m lp.CCMessage) {
8180 deviceState , ok = devicesOfHostState [deviceId ]
8281 if ! ok {
8382 deviceState = & MedianDeviceState {
84- powerSamples : make ([]float64 , 0 ),
83+ powerSamples : make ([]float64 , 0 ),
8584 performanceSamples : make ([]float64 , 0 ),
8685 }
8786 devicesOfHostState [deviceId ] = deviceState
0 commit comments