forked from grafana/k6
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix TrendSink median calculation as part of Thresholds.Run
This commit addresses the issues outlined in grafana#2755. We assume that because the trend sink median computation can turn out to be quite expensive (it involves sorting the array of values), it was so far delegated to the last moment: thresholds evaluation and summary generation. This detail appeared to be missed in the most recent thresholds refactoring, and the `Calc` method was never used by the `Thresholds.Run` method. This commit ensures that in the same fashion as with Trend Sinks percentiles, the thresholds evaluation also computes the sink's median value when necessary. This commit adds dedicated tests illustrating the behavior, and demonstrating that it solves said issue.
- Loading branch information
Showing
2 changed files
with
65 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters