Skip to content

Commit 5550586

Browse files
committed
go format
1 parent 7560e74 commit 5550586

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

internal/aggregator/lastAggregator_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func TestAggregateMultipleHosts(t *testing.T) {
139139

140140
for i, host := range hosts {
141141
target := Target{HostName: host, DeviceId: "0"}
142-
expectedEdp := power[i]/(instructions[i] * instructions[i])
142+
expectedEdp := power[i] / (instructions[i] * instructions[i])
143143
if edp[target] != expectedEdp {
144144
t.Errorf("expected %f, got %f", expectedEdp, edp[target])
145145
}

internal/aggregator/medianAggregator.go

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ import (
1414
)
1515

1616
type 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

2424
type MedianDeviceState struct {
@@ -30,12 +30,12 @@ type MedianDeviceState struct {
3030

3131
type 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

4141
func 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

internal/controller/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"encoding/json"
99
"fmt"
1010
"strconv"
11-
"sync"
1211
"strings"
12+
"sync"
1313
"time"
1414

1515
cclog "github.com/ClusterCockpit/cc-lib/ccLogger"

0 commit comments

Comments
 (0)