Merge pull request #13263 from spowelljr/make30Day
flake charts: allow toggling between all-time and last 90 day flake chartspull/12102/head
commit
3acd6d6fef
|
@ -23,6 +23,7 @@
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<div id="period_display"></div>
|
||||||
<div id="chart_div"></div>
|
<div id="chart_div"></div>
|
||||||
<div id="data_date_container" style="text-align: right; display: none">
|
<div id="data_date_container" style="text-align: right; display: none">
|
||||||
Data collected on <span id="data_date"></span>
|
Data collected on <span id="data_date"></span>
|
||||||
|
@ -33,4 +34,4 @@
|
||||||
el.setAttribute('src', `flake_chart.js?t=${Math.random()}`);
|
el.setAttribute('src', `flake_chart.js?t=${Math.random()}`);
|
||||||
document.head.appendChild(el);
|
document.head.appendChild(el);
|
||||||
</script>
|
</script>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -68,8 +68,9 @@ const testStatus = {
|
||||||
SKIPPED: "Skipped"
|
SKIPPED: "Skipped"
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loadTestData() {
|
async function loadTestData(period) {
|
||||||
const response = await fetch("data.csv", {
|
const file = period === "last90" ? "data-last-90.csv" : "data.csv";
|
||||||
|
const response = await fetch(file, {
|
||||||
headers: {
|
headers: {
|
||||||
"Cache-Control": "max-age=3600,must-revalidate",
|
"Cache-Control": "max-age=3600,must-revalidate",
|
||||||
}
|
}
|
||||||
|
@ -664,6 +665,9 @@ function displayEnvironmentChart(testData, environmentName) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function init() {
|
async function init() {
|
||||||
|
const query = parseUrlQuery(window.location.search);
|
||||||
|
const desiredTest = query.test, desiredEnvironment = query.env || "", desiredPeriod = query.period || "";
|
||||||
|
|
||||||
google.charts.load('current', { 'packages': ['corechart'] });
|
google.charts.load('current', { 'packages': ['corechart'] });
|
||||||
let testData, responseDate;
|
let testData, responseDate;
|
||||||
try {
|
try {
|
||||||
|
@ -671,16 +675,13 @@ async function init() {
|
||||||
// Only store the test data (at index 1) into `testData`.
|
// Only store the test data (at index 1) into `testData`.
|
||||||
[testData, responseDate] = (await Promise.all([
|
[testData, responseDate] = (await Promise.all([
|
||||||
new Promise(resolve => google.charts.setOnLoadCallback(resolve)),
|
new Promise(resolve => google.charts.setOnLoadCallback(resolve)),
|
||||||
loadTestData()
|
loadTestData(desiredPeriod)
|
||||||
]))[1];
|
]))[1];
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
displayError(err);
|
displayError(err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const query = parseUrlQuery(window.location.search);
|
|
||||||
const desiredTest = query.test, desiredEnvironment = query.env || "";
|
|
||||||
|
|
||||||
if (desiredTest === undefined) {
|
if (desiredTest === undefined) {
|
||||||
displayEnvironmentChart(testData, desiredEnvironment);
|
displayEnvironmentChart(testData, desiredEnvironment);
|
||||||
} else {
|
} else {
|
||||||
|
@ -688,6 +689,19 @@ async function init() {
|
||||||
}
|
}
|
||||||
document.querySelector('#data_date_container').style.display = 'block';
|
document.querySelector('#data_date_container').style.display = 'block';
|
||||||
document.querySelector('#data_date').innerText = responseDate.toLocaleString();
|
document.querySelector('#data_date').innerText = responseDate.toLocaleString();
|
||||||
|
let periodDisplay, newURL;
|
||||||
|
|
||||||
|
// we're going to take the current page URL (desiredPeriod) and modify it to create the link to the other page
|
||||||
|
if (desiredPeriod === 'last90') {
|
||||||
|
// remove '&period=last90' to make a link to the all-time data page
|
||||||
|
otherPeriodURL = window.location.href.replace(/&?period=last90/gi, '');
|
||||||
|
periodDisplay = `Currently viewing last 90 days of data: <a href="` + otherPeriodURL + `">View all-time data</a>`;
|
||||||
|
} else {
|
||||||
|
// add '&period=last90' to make a link to the last 90 days page
|
||||||
|
otherPeriodURL = window.location.href + '&period=last90';
|
||||||
|
periodDisplay = `Currently viewing all-time data: <a href="` + otherPeriodURL + `">View last 90 days of data</a>`;
|
||||||
|
}
|
||||||
|
document.querySelector('#period_display').innerHTML = periodDisplay;
|
||||||
}
|
}
|
||||||
|
|
||||||
init();
|
init();
|
||||||
|
|
|
@ -0,0 +1,108 @@
|
||||||
|
/*
|
||||||
|
Copyright 2021 The Kubernetes Authors All rights reserved.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bufio"
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
"log"
|
||||||
|
"os"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
dataFile := flag.String("source", "", "The source of the csv file to process")
|
||||||
|
dataLast90File := flag.String("target", "", "The target of the csv file containing last 90 days of data")
|
||||||
|
flag.Parse()
|
||||||
|
|
||||||
|
if *dataFile == "" || *dataLast90File == "" {
|
||||||
|
fmt.Println("All flags are required and cannot be empty")
|
||||||
|
flag.PrintDefaults()
|
||||||
|
}
|
||||||
|
|
||||||
|
data, err := os.Open(*dataFile)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed opening source file %q: %v", *dataFile, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
dataLast90, err := os.OpenFile(*dataLast90File, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed creating target file %q: %v", *dataLast90File, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
dw := bufio.NewWriter(dataLast90)
|
||||||
|
|
||||||
|
cutoffDate := time.Now().AddDate(0, 0, -90)
|
||||||
|
|
||||||
|
// to save space we don't repeat duplicate back to back lines if they have the same value
|
||||||
|
// for example:
|
||||||
|
// 2021-09-10,TestOffline,Passed
|
||||||
|
// ,TestForceSystemd,
|
||||||
|
// So the date for line two will be empty, so we need to remember the last line that had a date if it's within last 90 days or not
|
||||||
|
validDate := true
|
||||||
|
|
||||||
|
s := bufio.NewScanner(data)
|
||||||
|
for s.Scan() {
|
||||||
|
line := s.Text()
|
||||||
|
stringDate := strings.Split(line, ",")[1]
|
||||||
|
|
||||||
|
// copy headers
|
||||||
|
if stringDate == "Test Date" {
|
||||||
|
write(dw, line)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if stringDate == "" {
|
||||||
|
if validDate {
|
||||||
|
write(dw, line)
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
testDate, err := time.Parse("2006-01-02", stringDate)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to parse date %q: %v", stringDate, err)
|
||||||
|
}
|
||||||
|
if testDate.Before(cutoffDate) {
|
||||||
|
validDate = false
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
validDate = true
|
||||||
|
write(dw, line)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := dw.Flush(); err != nil {
|
||||||
|
log.Fatalf("failed to flush data writer: %v", err)
|
||||||
|
}
|
||||||
|
if err := s.Err(); err != nil {
|
||||||
|
log.Fatalf("scanner had an error: %v", err)
|
||||||
|
}
|
||||||
|
if err := data.Close(); err != nil {
|
||||||
|
log.Fatalf("failed to close source file: %v", err)
|
||||||
|
}
|
||||||
|
if err := dataLast90.Close(); err != nil {
|
||||||
|
log.Fatalf("failed to close target file: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func write(dw *bufio.Writer, line string) {
|
||||||
|
if _, err := dw.WriteString(line + "\n"); err != nil {
|
||||||
|
log.Fatalf("failed to write to data writer: %v", err)
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright 2022 The Kubernetes Authors All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
set -eux -o pipefail
|
||||||
|
|
||||||
|
# Get directory of script.
|
||||||
|
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||||
|
|
||||||
|
"${DIR}/../../installers/check_install_golang.sh" || true
|
||||||
|
|
||||||
|
DATA_CSV=$(mktemp)
|
||||||
|
DATA_LAST_90_CSV=$(mktemp)
|
||||||
|
|
||||||
|
gsutil cp gs://minikube-flake-rate/data.csv "$DATA_CSV"
|
||||||
|
|
||||||
|
go run "${DIR}/process_last_90.go" --source "$DATA_CSV" --target "$DATA_LAST_90_CSV"
|
||||||
|
|
||||||
|
gsutil cp "$DATA_LAST_90_CSV" gs://minikube-flake-rate/data-last-90.csv
|
||||||
|
|
||||||
|
rm "$DATA_CSV" "$DATA_LAST_90_CSV"
|
|
@ -83,6 +83,7 @@ if [[ "${MINIKUBE_LOCATION}" == "master" ]]; then
|
||||||
SUMMARY="${BUCKET_PATH}/${ENVIRONMENT}_summary.json"
|
SUMMARY="${BUCKET_PATH}/${ENVIRONMENT}_summary.json"
|
||||||
"${DIR}/upload_tests.sh" "${SUMMARY}" || true
|
"${DIR}/upload_tests.sh" "${SUMMARY}" || true
|
||||||
done
|
done
|
||||||
|
"${DIR}/process_last_90/process_last_90.sh"
|
||||||
else
|
else
|
||||||
"${DIR}/report_flakes.sh" "${MINIKUBE_LOCATION}" "${ROOT_JOB_ID}" "${FINISHED_LIST}"
|
"${DIR}/report_flakes.sh" "${MINIKUBE_LOCATION}" "${ROOT_JOB_ID}" "${FINISHED_LIST}"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -7,18 +7,18 @@ description: >
|
||||||
|
|
||||||
|OS|Driver|ContainerRuntime|Link|
|
|OS|Driver|ContainerRuntime|Link|
|
||||||
|---|---|---|---|
|
|---|---|---|---|
|
||||||
|Linux|docker|docker|[Docker_Linux](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=Docker_Linux)|
|
|Linux|docker|docker|[Docker_Linux](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=Docker_Linux&period=last90)|
|
||||||
|Linux|docker|containerd|[Docker_Linux_containerd](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=Docker_Linux_containerd)|
|
|Linux|docker|containerd|[Docker_Linux_containerd](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=Docker_Linux_containerd&period=last90)|
|
||||||
|Linux|docker|crio|[Docker_Linux_crio](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=Docker_Linux_crio)|
|
|Linux|docker|crio|[Docker_Linux_crio](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=Docker_Linux_crio&period=last90)|
|
||||||
|Linux - arm64|docker|crio|[Docker_Linux_crio_arm64](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=Docker_Linux_crio_arm64)|
|
|Linux - arm64|docker|crio|[Docker_Linux_crio_arm64](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=Docker_Linux_crio_arm64&period=last90)|
|
||||||
|Linux - arm64|docker|docker|[Docker_Linux_docker_arm64](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=Docker_Linux_docker_arm64)|
|
|Linux - arm64|docker|docker|[Docker_Linux_docker_arm64](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=Docker_Linux_docker_arm64&period=last90)|
|
||||||
|Linux|kvm2|docker|[KVM_Linux](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=KVM_Linux)|
|
|Linux|kvm2|docker|[KVM_Linux](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=KVM_Linux&period=last90)|
|
||||||
|Linux|kvm2|containerd|[KVM_Linux_containerd](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=KVM_Linux_containerd)|
|
|Linux|kvm2|containerd|[KVM_Linux_containerd](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=KVM_Linux_containerd&period=last90)|
|
||||||
|Linux|kvm2|crio|[KVM_Linux_crio](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=KVM_Linux_crio)|
|
|Linux|kvm2|crio|[KVM_Linux_crio](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=KVM_Linux_crio&period=last90)|
|
||||||
|Linux|virtualbox|docker|[VirtualBox_Linux](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=VirtualBox_Linux)|
|
|Linux|virtualbox|docker|[VirtualBox_Linux](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=VirtualBox_Linux&period=last90)|
|
||||||
|Linux|none|docker|[none_Linux](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=none_Linux)|
|
|Linux|none|docker|[none_Linux](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=none_Linux&period=last90)|
|
||||||
|MacOS|docker|docker|[Docker_macOS](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=Docker_macOS)|
|
|MacOS|docker|docker|[Docker_macOS](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=Docker_macOS&period=last90)|
|
||||||
|MacOS|hyperkit|docker|[Hyperkit_macOS](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=Hyperkit_macOS)|
|
|MacOS|hyperkit|docker|[Hyperkit_macOS](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=Hyperkit_macOS&period=last90)|
|
||||||
|Windows|docker|docker|[Docker_Windows](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=Docker_Windows)|
|
|Windows|docker|docker|[Docker_Windows](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=Docker_Windows&period=last90)|
|
||||||
|Windows|hyperv|docker|[Hyper-V_Windows](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=Hyper-V_Windows)|
|
|Windows|hyperv|docker|[Hyper-V_Windows](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=Hyper-V_Windows&period=last90)|
|
||||||
|Cloud Shell|docker|docker|[Docker_Cloud_Shell](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=Docker_Cloud_Shell)|
|
|Cloud Shell|docker|docker|[Docker_Cloud_Shell](https://storage.googleapis.com/minikube-flake-rate/flake_chart.html?env=Docker_Cloud_Shell&period=last90)|
|
||||||
|
|
Loading…
Reference in New Issue