diff --git a/go.mod b/go.mod index 7c8ac0a8725..a892da67faa 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/golang/protobuf v1.5.4 github.com/gorilla/websocket v1.5.1 github.com/grafana/xk6-browser v1.5.1 - github.com/grafana/xk6-dashboard v0.7.2 + github.com/grafana/xk6-dashboard v0.7.3 github.com/grafana/xk6-output-prometheus-remote v0.3.1 github.com/grafana/xk6-redis v0.2.0 github.com/grafana/xk6-webcrypto v0.3.0 diff --git a/go.sum b/go.sum index 575250d8c1c..1f1b8a2a0ac 100644 --- a/go.sum +++ b/go.sum @@ -94,8 +94,8 @@ github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/ github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= github.com/grafana/xk6-browser v1.5.1 h1:wexnBtx1raDniYcXkRQ9zfXvuJGjvixZag4kmiYG3tg= github.com/grafana/xk6-browser v1.5.1/go.mod h1:hD9H1zpe1Fvs6RCENKnaPqpObh6alz+hX00Xf5qvDE4= -github.com/grafana/xk6-dashboard v0.7.2 h1:CLaWeRfPZ388IS6rBn0nI+lqtX50QoQ73z0Hz5BIrS4= -github.com/grafana/xk6-dashboard v0.7.2/go.mod h1:7HLAY4udlWGXGDQL5gWIi+In3eZRljXi8AnHt1Z+lFM= +github.com/grafana/xk6-dashboard v0.7.3 h1:47dxL87eMhpCIHSJTOnohTq3WIfCwvNriRTDvYNlsHY= +github.com/grafana/xk6-dashboard v0.7.3/go.mod h1:7HLAY4udlWGXGDQL5gWIi+In3eZRljXi8AnHt1Z+lFM= github.com/grafana/xk6-output-prometheus-remote v0.3.1 h1:X23rQzlJD8dXWB31DkxR4uPnuRFo8L0Y0H22fSG9xl0= github.com/grafana/xk6-output-prometheus-remote v0.3.1/go.mod h1:0JLAm4ONsNUlNoxJXAwOCfA6GtDwTPs557OplAvE+3o= github.com/grafana/xk6-redis v0.2.0 h1:iXmAKVlAxafZ/h8ptuXTFhGu63IFsyDI8QjUgWm66BU= diff --git a/vendor/github.com/grafana/xk6-dashboard/dashboard/aggregate.go b/vendor/github.com/grafana/xk6-dashboard/dashboard/aggregate.go index abdaee7072e..f4b5782883f 100644 --- a/vendor/github.com/grafana/xk6-dashboard/dashboard/aggregate.go +++ b/vendor/github.com/grafana/xk6-dashboard/dashboard/aggregate.go @@ -42,7 +42,7 @@ type aggregator struct { once sync.Once - seenMetrics map[string]struct{} + seenMetrics []string } func closer(what io.Closer, logger logrus.FieldLogger) { @@ -57,7 +57,7 @@ func aggregate(input, output string, opts *options, proc *process) error { agg.registry = newRegistry() agg.options = opts agg.logger = proc.logger - agg.seenMetrics = make(map[string]struct{}) + agg.seenMetrics = make([]string, 0) var inputFile, outputFile afero.File var err error @@ -176,8 +176,9 @@ func (agg *aggregator) updateAndSend( return } - newbies := met.newbies(agg.seenMetrics) + newbies, updated := met.newbies(agg.seenMetrics) if len(newbies) != 0 { + agg.seenMetrics = updated agg.fireEvent(metricEvent, newbies) } @@ -221,7 +222,15 @@ func (agg *aggregator) processMetric(data []byte) error { name := gjson.GetBytes(data, "data.name").String() - _, err = agg.registry.getOrNew(name, metricType, valueType) + tres := gjson.GetBytes(data, "data.thresholds").Array() + + thresholds := make([]string, 0, len(tres)) + + for _, res := range tres { + thresholds = append(thresholds, res.String()) + } + + _, err = agg.registry.getOrNew(name, metricType, valueType, thresholds) return err } diff --git a/vendor/github.com/grafana/xk6-dashboard/dashboard/assets/packages/report/dist/index.html b/vendor/github.com/grafana/xk6-dashboard/dashboard/assets/packages/report/dist/index.html index 69b844d295a..be4f0b4e9af 100644 --- a/vendor/github.com/grafana/xk6-dashboard/dashboard/assets/packages/report/dist/index.html +++ b/vendor/github.com/grafana/xk6-dashboard/dashboard/assets/packages/report/dist/index.html @@ -15,17 +15,17 @@ k6 report