-
Notifications
You must be signed in to change notification settings - Fork 0
/
output.go
48 lines (40 loc) · 889 Bytes
/
output.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package main
import (
"path/filepath"
"go.uber.org/zap"
"gonum.org/v1/plot/plotter"
)
const (
XLabel = "samples"
TpsYLabel = "tps"
LatencyYLabel = "latency"
PngSuffix = ".png"
)
func outputSummary(rs ResultsSummary) {
name := iInput.name() + "_" + iInput.info()
e := DrawValues(
name,
XLabel,
LatencyYLabel,
filepath.Join(ImagesLatencyDir, name+PngSuffix),
rs.LatencySummary.Latencies,
)
if e != nil {
logger.Error("DrawValues err", zap.String("err", e.Error()))
}
xyz := make(plotter.XYs, 0, len(rs.TPSes))
for i, tps := range rs.TPSes {
xyz = append(xyz, plotter.XY{X: float64(i + 1), Y: tps})
}
e = DrawXYs(
name,
XLabel,
TpsYLabel,
filepath.Join(ImagesTpsDir, name+PngSuffix),
xyz,
) // TODO fix execute slowly when points > 10000
if e != nil {
logger.Error("DrawXYs err", zap.String("err", e.Error()))
}
saveTest(rs)
}