Fix lint error

pull/11140/head
Kent Iso 2021-04-27 23:08:36 +09:00
parent 1edbcc94e3
commit 67da2c88ce
2 changed files with 19 additions and 25 deletions

View File

@ -173,19 +173,19 @@ func execute() error {
var napCPU []plotter.XY
for i := range napResults {
napXPos := float64(i)-0.25
napYPos := napResults[i]+0.1
napXPos := float64(i) - 0.25
napYPos := napResults[i] + 0.1
napXY := plotter.XY{X: napXPos, Y: napYPos}
napCPU = append(napCPU, napXY)
}
// CPU Busy% non-autopause data label
napl, err := plotter.NewLabels(plotter.XYLabels{
XYs: napCPU,
Labels: napLabels,
},
XYs: napCPU,
Labels: napLabels,
},
)
if err != nil {
log.Fatalf("could not creates labels plotter: %+v", err)
return err
}
// Set auto-pause data label to each bar
@ -201,8 +201,8 @@ func execute() error {
var apCPU []plotter.XY
for i := range apResults {
apXPos := float64(i)+0.05
apYPos := apResults[i]+0.1
apXPos := float64(i) + 0.05
apYPos := apResults[i] + 0.1
apXY := plotter.XY{X: apXPos, Y: apYPos}
apCPU = append(apCPU, apXY)
}
@ -213,12 +213,9 @@ func execute() error {
},
)
if err != nil {
log.Fatalf("could not creates labels plotter: %+v", err)
}
var t []plot.Tick
for i := math.Trunc(0); i <= 300; i += 50 {
t = append(t, plot.Tick{Value: i, Label: fmt.Sprint(i)})
return err
}
// define max cpu busy% to 20%
p.Y.Max = 20
p.Y.Tick.Marker = integerTicks{}
@ -238,4 +235,4 @@ func execute() error {
log.Printf("Generated graph png to %s/linux.png", FOLDER)
}
return nil
}
}

View File

@ -130,24 +130,21 @@ func execute() error {
var xysCPU []plotter.XY
for i := range results {
rxPos := float64(i)-0.13
ryPos := results[i]+0.1
rxPos := float64(i) - 0.13
ryPos := results[i] + 0.1
cXY := plotter.XY{X: rxPos, Y: ryPos}
xysCPU = append(xysCPU, cXY)
}
// CPU Busy% data label
cl, err := plotter.NewLabels(plotter.XYLabels{
XYs: xysCPU,
Labels: cpuLabels,
},
XYs: xysCPU,
Labels: cpuLabels,
},
)
if err != nil {
log.Fatalf("could not creates labels plotter: %+v", err)
}
var t []plot.Tick
for i := math.Trunc(0); i <= 300; i += 50 {
t = append(t, plot.Tick{Value: i, Label: fmt.Sprint(i)})
return err
}
// define max cpu busy% to 20%
p.Y.Max = 20
p.Y.Tick.Marker = integerTicks{}
@ -167,4 +164,4 @@ func execute() error {
log.Printf("Generated graph png to %s/linux.png", FOLDER)
}
return nil
}
}