We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5b3e1f1 commit 33a4243Copy full SHA for 33a4243
pkg/testing/tools/slope.go
@@ -13,13 +13,14 @@ import (
13
// Slope is a slim wrapper around a regression library for calculating rate of change over time in tests.
14
type Slope struct {
15
handler *regression.Regression
16
+ label string
17
}
18
19
func NewSlope(label string) Slope {
20
handler := new(regression.Regression)
21
handler.SetObserved(label)
22
handler.SetVar(0, "time")
- return Slope{handler: handler}
23
+ return Slope{handler: handler, label: label}
24
25
26
// add a datapoint and timestamp to the calculaton.
@@ -46,3 +47,7 @@ func (slope Slope) Formula() string {
46
47
func (slope Slope) Debug() string {
48
return slope.handler.String()
49
50
+
51
+func (slope Slope) Name() string {
52
+ return slope.label
53
+}
0 commit comments