-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from Alan-Jowett/stats_check
Add script to do statisical check on results
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
Copyright (c) Microsoft Corporation | ||
SPDX-License-Identifier: MIT | ||
*/ | ||
WITH samples AS ( | ||
SELECT metric, value, "timestamp", | ||
ROW_NUMBER() OVER (PARTITION BY metric ORDER BY "timestamp" DESC) AS row_num | ||
FROM benchmarkresults | ||
WHERE platform = 'Windows 2019' | ||
AND repository = 'microsoft/ebpf-for-windows' | ||
AND "timestamp" >= NOW() - INTERVAL '30 days' | ||
), | ||
stats AS ( | ||
SELECT metric, | ||
AVG(value) as mean_value, | ||
STDDEV(value) as stddev_value | ||
FROM benchmarkresults | ||
WHERE platform = 'Windows 2019' | ||
AND repository = 'microsoft/ebpf-for-windows' | ||
AND "timestamp" >= NOW() - INTERVAL '30 days' | ||
GROUP BY metric | ||
) | ||
SELECT samples.timestamp, samples.metric, samples.value, stats.mean_value, stats.stddev_value | ||
FROM samples | ||
INNER JOIN stats ON samples.metric = stats.metric | ||
WHERE ABS(samples.value - stats.mean_value) >= 2 * stats.stddev_value AND row_num = 1; |