Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

action: fix benchmark on schedule without cache will panic #1262

Merged
merged 2 commits into from
May 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
schedule:
# Run at 03:00 clock UTC on Monday and Wednesday
- cron: "0 03 * * 1,3"
pull_request:
paths:
- '.github/workflows/benchmark.yml'
- 'misc/benchmark/*'
workflow_dispatch:

env:
Expand Down
18 changes: 10 additions & 8 deletions misc/benchmark/benchmark_summary.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env python3

import csv
import subprocess
import os
import subprocess
from argparse import ArgumentParser

COMMANDS_BENCHMARK = [
Expand Down Expand Up @@ -72,22 +72,24 @@ def print_csv_compare(self):
print_compare(item[0], item[1])

def print_csv_schedule(self):
print("| bench-result(current vs last) | pull(s) | create(s) | run(s) | total(s) | size(MB) | read-amount(MB) | read-count |")
print("|:------------------------------|:-------:|:---------:|:------:|:--------:|:--------:|:---------------:|:----------:|")
data = []
if os.path.exists(BENCHMARK_CACHE):
print("| bench-result(current vs last) | pull(s) | create(s) | run(s) | total(s) | size(MB) | read-amount(MB) | read-count |")
print("|:------------------------------|:-------:|:---------:|:------:|:--------:|:--------:|:---------------:|:----------:|")
with open(BENCHMARK_CACHE, "r", newline='') as f:
reader = csv.reader(f, delimiter='|')
next(reader) # head
next(reader) # line
next(reader) # oci
for row in reader:
data.append(row[2:-1])
for index, file in enumerate(FILE_LIST):
if(file == "oci.csv") or index > len(data):
print_schedule(file)
else:
print_schedule(file, data[index-1])
for index, file in enumerate(FILE_LIST):
if (file == "oci.csv"):
print_schedule(file)
else:
print_schedule(file, data[index-1])
else:
self.print_csv_result()
self.save_cache()

def prepare_csv(self):
Expand Down