@@ -23,6 +23,11 @@ type BenchResult struct {
23
23
hasErrors * bool
24
24
}
25
25
26
+ type Metric struct {
27
+ Name string `json:"name"`
28
+ Value interface {} `json:"value"`
29
+ }
30
+
26
31
func (r * BenchResult ) EvergreenPerfFormat () ([]interface {}, error ) {
27
32
timings := r .timings ()
28
33
@@ -43,33 +48,35 @@ func (r *BenchResult) EvergreenPerfFormat() ([]interface{}, error) {
43
48
44
49
out := []interface {}{
45
50
map [string ]interface {}{
46
- "name" : r .Name + "-throughput" ,
47
- "results" : map [string ]interface {}{
48
- "1" : map [string ]interface {}{
49
- "seconds" : r .Duration .Round (time .Millisecond ).Seconds (),
50
- "ops_per_second" : r .getThroughput (median ),
51
- "ops_per_second_values" : []float64 {
52
- r .getThroughput (min ),
53
- r .getThroughput (max ),
54
- },
51
+ "info" : map [string ]interface {}{
52
+ "test_name" : r .Name + "-throughput" ,
53
+ "args" : map [string ]interface {}{
54
+ "threads" : 1 ,
55
55
},
56
56
},
57
+ "metrics" : []Metric {
58
+ {Name : "seconds" , Value : r .Duration .Round (time .Millisecond ).Seconds ()},
59
+ {Name : "ops_per_second" , Value : r .getThroughput (median )},
60
+ {Name : "ops_per_second_min" , Value : r .getThroughput (min )},
61
+ {Name : "ops_per_second_max" , Value : r .getThroughput (max )},
62
+ },
57
63
},
58
64
}
59
65
60
66
if r .DataSize > 0 {
61
67
out = append (out , interface {}(map [string ]interface {}{
62
- "name" : r .Name + "-MB-adjusted" ,
63
- "results" : map [string ]interface {}{
64
- "1" : map [string ]interface {}{
65
- "seconds" : r .Duration .Round (time .Millisecond ).Seconds (),
66
- "ops_per_second" : r .adjustResults (median ),
67
- "ops_per_second_values" : []float64 {
68
- r .adjustResults (min ),
69
- r .adjustResults (max ),
70
- },
68
+ "info" : map [string ]interface {}{
69
+ "test_name" : r .Name + "-MB-adjusted" ,
70
+ "args" : map [string ]interface {}{
71
+ "threads" : 1 ,
71
72
},
72
73
},
74
+ "metrics" : []Metric {
75
+ {Name : "seconds" , Value : r .Duration .Round (time .Millisecond ).Seconds ()},
76
+ {Name : "ops_per_second" , Value : r .adjustResults (median )},
77
+ {Name : "ops_per_second_min" , Value : r .adjustResults (min )},
78
+ {Name : "ops_per_second_max" , Value : r .adjustResults (max )},
79
+ },
73
80
}))
74
81
}
75
82
0 commit comments