From 2d39e6d5edf6dfa33595b85f47b8a05999d8de23 Mon Sep 17 00:00:00 2001 From: Srishti-8976 Date: Wed, 17 Dec 2025 00:33:41 +0530 Subject: [PATCH 1/6] Create perfTestRunner_csv.py --- perfTestRunner_csv.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 perfTestRunner_csv.py diff --git a/perfTestRunner_csv.py b/perfTestRunner_csv.py new file mode 100644 index 0000000..7b32110 --- /dev/null +++ b/perfTestRunner_csv.py @@ -0,0 +1 @@ +print("CSV PERF TEST RUNNER STARTED") From 9be8e3cdab828202dbf528ac8c4db2311294ec82 Mon Sep 17 00:00:00 2001 From: Srishti-8976 Date: Wed, 17 Dec 2025 11:10:30 +0530 Subject: [PATCH 2/6] Integrate CSV performance writer into perfTestRunner --- perfTestRunner.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/perfTestRunner.py b/perfTestRunner.py index 1e69d56..df60dec 100644 --- a/perfTestRunner.py +++ b/perfTestRunner.py @@ -3,6 +3,8 @@ import time import os from datetime import date, datetime +from perf_csv_writer import write_perf_csv + now = datetime.now() current_time = now.strftime("%H:%M:%S") @@ -154,6 +156,15 @@ def perform_load_test(): # Save results after successful test execution save_results(test_data) + # Write CSV performance report (new file, no overwrite) + if "train" in test_data["results"] and "match" in test_data["results"]: + write_perf_csv( + test_name=testName, + train_time=test_data["results"]["train"], + match_time=test_data["results"]["match"] + ) + + if test_fail: exit(1) From 74156ce72a8823cfc8b7332cf35bb0acad5cbd51 Mon Sep 17 00:00:00 2001 From: Srishti-8976 Date: Wed, 17 Dec 2025 11:15:27 +0530 Subject: [PATCH 3/6] Undone all the changes. Did changes in patch-2. --- perfTestRunner.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/perfTestRunner.py b/perfTestRunner.py index df60dec..0a15e69 100644 --- a/perfTestRunner.py +++ b/perfTestRunner.py @@ -3,7 +3,7 @@ import time import os from datetime import date, datetime -from perf_csv_writer import write_perf_csv + now = datetime.now() @@ -156,14 +156,6 @@ def perform_load_test(): # Save results after successful test execution save_results(test_data) - # Write CSV performance report (new file, no overwrite) - if "train" in test_data["results"] and "match" in test_data["results"]: - write_perf_csv( - test_name=testName, - train_time=test_data["results"]["train"], - match_time=test_data["results"]["match"] - ) - if test_fail: exit(1) From 88ef6f9284187420f5e29c9f0306c247e3cabf9e Mon Sep 17 00:00:00 2001 From: Srishti-8976 Date: Fri, 6 Feb 2026 22:18:37 +0530 Subject: [PATCH 4/6] Implement CSV reporting for performance test results Added functionality to write performance test results to a CSV file, including date, year, test name, phase, and duration. --- perfTestRunner.py | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/perfTestRunner.py b/perfTestRunner.py index 0a15e69..22173ae 100644 --- a/perfTestRunner.py +++ b/perfTestRunner.py @@ -1,11 +1,20 @@ -import subprocess +import os import json import time -import os +import subprocess +import csv +from pathlib import Path from datetime import date, datetime +REPORTS_DIR = Path("perf_reports") +REPORTS_DIR.mkdir(parents=True, exist_ok=True) + +CSV_FILE = REPORTS_DIR / f"perf_{date.today().isoformat()}.csv" + + + now = datetime.now() current_time = now.strftime("%H:%M:%S") TIMESTAMP = datetime.now().strftime("%Y%m%d_%H%M%S") @@ -118,6 +127,31 @@ def compare_results(prev_results, new_results): test_fail = True return test_fail +def write_csv_results(test_name, results): + with open(CSV_FILE, mode="w", newline="") as f: + writer = csv.writer(f) + + writer.writerow([ + "date", + "year", + "test_name", + "phase", + "duration_minutes" + ]) + + today = date.today() + year = today.year + + for phase, duration in results.items(): + if isinstance(duration, (int, float)): + writer.writerow([ + today.isoformat(), + year, + test_name, + phase, + duration + ]) + def perform_load_test(): @@ -156,6 +190,9 @@ def perform_load_test(): # Save results after successful test execution save_results(test_data) + #Saving it into csv file in the same repo + write_csv_results(test_name, test_data["results"]) + if test_fail: exit(1) From 59d882ee4306e85e15c15716d30ee89a1e62a807 Mon Sep 17 00:00:00 2001 From: Srishti-8976 Date: Fri, 6 Feb 2026 22:22:03 +0530 Subject: [PATCH 5/6] Add GitHub Actions workflow for performance tests --- .github/workflows/perf-tests.yml | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/perf-tests.yml diff --git a/.github/workflows/perf-tests.yml b/.github/workflows/perf-tests.yml new file mode 100644 index 0000000..00f162d --- /dev/null +++ b/.github/workflows/perf-tests.yml @@ -0,0 +1,37 @@ +name: Performance Tests + +on: + schedule: + - cron: "0 2 */3 * *" + workflow_dispatch: + +jobs: + run-perf-tests: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Install dependencies + run: | + pip install -r requirements.txt + + - name: Run performance tests + env: + INPUT: config.json + run: | + python perfTestRunner.py + + - name: Commit performance report + run: | + git config user.name "github-actions" + git config user.email "github-actions@github.com" + git add perf_reports/ + git commit -m "Add performance report $(date +'%Y-%m-%d')" || echo "No changes" + git push From 6f2aa922117102f03682facb3060510c5ed3562b Mon Sep 17 00:00:00 2001 From: Srishti-8976 Date: Sat, 7 Feb 2026 21:48:43 +0530 Subject: [PATCH 6/6] Update perf-tests.yml