Skip to content

Commit afcf0f0

Browse files
some minor changes
1 parent 7e6aedb commit afcf0f0

8 files changed

Lines changed: 57 additions & 47 deletions

File tree

.github/workflows/updated_graph.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

perfTestRunner.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ def detect_pc_specs():
5252
except Exception:
5353
specs["Storage"] = "N/A"
5454
try:
55+
5556
r = subprocess.run(["spark-submit", "--version"], capture_output=True, text=True, timeout=10)
57+
#spark often prints out it version through the error stream, hence(stdout+stderr)
5658
for line in (r.stderr + r.stdout).splitlines():
5759
if "version" in line.lower():
5860
specs["Spark"] = line.strip()
@@ -103,9 +105,13 @@ def load_results():
103105
"""Load previous test results if available."""
104106

105107
results = {}
108+
report_dir = os.path.dirname(reportFile) if reportFile else ""
106109

107110
for phase in tests.keys():
108-
phase_file = f"{test_prefix}_{phase}_report.csv"
111+
if report_dir:
112+
phase_file = os.path.join(report_dir, f"{test_prefix}_{phase}_report.csv")
113+
else:
114+
phase_file = f"{test_prefix}_{phase}_report.csv"
109115

110116
if os.path.exists(phase_file) and os.path.getsize(phase_file)>0:
111117
with open(phase_file, "r") as f:
@@ -124,9 +130,14 @@ def save_results(data):
124130
"""Save current test results to the report file"""
125131

126132
current_year = str(date.today().year)
133+
report_dir = os.path.dirname(reportFile) if reportFile else ""
127134

128135
for phase, duration in data["results"].items():
129-
phase_file = f"{test_prefix}_{phase}_report.csv"
136+
if report_dir:
137+
os.makedirs(os.path.abspath(report_dir), exist_ok=True)
138+
phase_file = os.path.join(report_dir, f"{test_prefix}_{phase}_report.csv")
139+
else:
140+
phase_file = f"{test_prefix}_{phase}_report.csv"
130141

131142
# -----YEARLY ROLLOVER CHECK---
132143
if os.path.exists(phase_file) and os.path.getsize(phase_file)>0:

performance_chart.png

-7.85 KB
Loading

plot_result.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def generate_chart():
3737
config_path = sorted(configs)[0]
3838
pc_specs = {}
3939
data_specs = {}
40+
report_file = ""
4041

4142
if os.path.exists(config_path):
4243
try:
@@ -54,10 +55,11 @@ def generate_chart():
5455
except Exception as e:
5556
print(f"Error loading config file: {config_path}: {e}")
5657

57-
# 2. Read report files — keyed by (dataset, phase)
5858
KNOWN_PHASES = ["train", "match"]
5959
series = {}
60-
for file_path in sorted(glob.glob("*_report.csv")):
60+
report_dir = os.path.dirname(report_file) if report_file else ""
61+
csv_pattern = os.path.join(report_dir, "*_report.csv") if report_dir else "*_report.csv"
62+
for file_path in sorted(glob.glob(csv_pattern)):
6163
basename = os.path.basename(file_path).replace("_report.csv", "")
6264
phase = next((p for p in KNOWN_PHASES if basename == p or basename.endswith(f"_{p}")), None)
6365
if phase is None:
@@ -134,6 +136,9 @@ def concat_phase(phase_name):
134136
ax.tick_params(axis='both', colors='#8e8f9e', labelsize=8.5)
135137
ax.grid(True, color='#222332', linestyle=':', linewidth=0.8)
136138

139+
max_duration = max(df["duration"].max() for df in series.values())
140+
ax.set_ylim(0, max_duration * 1.3)
141+
137142

138143
for spine in ['top', 'right']:
139144
ax.spines[spine].set_visible(False)
@@ -150,11 +155,9 @@ def concat_phase(phase_name):
150155
today_str = datetime.now().strftime("%Y-%m-%d")
151156
fig.text(0.94, 0.953, f"Generated: {today_str}", color='#8e8f9e', fontsize=8.5, ha='right')
152157

153-
# 7. Render Footer Specs Section
154158
ax_footer = fig.add_subplot(gs[1])
155159
ax_footer.axis('off')
156160

157-
# PC Specs
158161
ax_footer.text(0.02, 0.85, "PC Specs", color='#ffffff', fontsize=10.5, fontweight='bold')
159162
pc_keys = ["OS", "CPU", "RAM", "Storage", "Spark", "Java"]
160163
y_pos = 0.65
@@ -176,7 +179,6 @@ def concat_phase(phase_name):
176179
ax_footer.text(0.11, y_pos, val, color='#cbd5e1', fontsize=8.5)
177180
y_pos -= 0.12
178181

179-
# Data Specs
180182
ax_footer.text(0.35, 0.85, "Data Specs", color='#ffffff', fontsize=10.5, fontweight='bold')
181183
data_keys = ["Dataset", "Records", "Fields", "Pairs", "Blocking", "Model"]
182184
y_pos = 0.65
@@ -189,7 +191,6 @@ def concat_phase(phase_name):
189191
ax_footer.text(0.44, y_pos, val, color='#cbd5e1', fontsize=8.5)
190192
y_pos -= 0.12
191193

192-
# Run Summary
193194
ax_footer.text(0.76, 0.85, "Run Summary", color='#ffffff', fontsize=10.5, fontweight='bold')
194195
summary_items = [
195196
("Total Runs", f"{total_runs}"),
@@ -205,10 +206,15 @@ def concat_phase(phase_name):
205206
ax_footer.text(0.87, y_pos, val, color='#cbd5e1', fontsize=8.5)
206207
y_pos -= 0.12
207208

208-
# Save output image
209-
plt.savefig("performance_chart.png", dpi=150, bbox_inches='tight', facecolor=fig.get_facecolor())
209+
chart_dir = os.path.dirname(report_file) if report_file else ""
210+
if chart_dir:
211+
os.makedirs(chart_dir, exist_ok=True)
212+
chart_path = os.path.join(chart_dir, "performance_chart.png")
213+
else:
214+
chart_path = "performance_chart.png"
215+
plt.savefig(chart_path, dpi=150, bbox_inches='tight', facecolor=fig.get_facecolor())
210216
plt.close()
211-
print("Performance chart successfully updated at performance_chart.png!")
217+
print(f"Performance chart successfully updated at {chart_path}!")
212218

213219
if __name__ == "__main__":
214220
generate_chart()
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
date,time,test,duration
2+
2026-06-29,21:58:05,Dummy Performance Test,0.0
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
date,time,test,duration
2+
2026-06-29,21:58:05,Dummy Performance Test,0.0
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"date": "2026-06-29",
3+
"time": "21:58:05",
4+
"test": "Dummy Performance Test",
5+
"results": {
6+
"train": 0.0,
7+
"match": 0.0
8+
},
9+
"pcSpecs": {
10+
"OS": "Darwin 25.5.0",
11+
"CPU": "arm \u00b7 10 cores",
12+
"RAM": "24 GB",
13+
"Storage": "460 GB",
14+
"Spark": "/___/ .__/\\_,_/_/ /_/\\_\\ version 3.5.1",
15+
"Java": "openjdk version 11.0.31 2026-04-21"
16+
},
17+
"dataSpecs": {
18+
"Dataset": "FEBRL 120K",
19+
"Records": "1,20,000",
20+
"Fields": "10 (givenname, surname, address...)",
21+
"Pairs": "100 labelled pairs",
22+
"Blocking": "2 blocking rules",
23+
"Model": "Random Forest"
24+
}
25+
}
109 KB
Loading

0 commit comments

Comments
 (0)