Normalize generated measurement evidence formatting

This commit is contained in:
Steffen committed 2026-10-09 12:29:01 +02:00
1 parent e5f00796af
commit 5d9371388c
8 files changed
+29320 -29319

No files matched your search

+3 -2
View File
@@ -16,11 +16,11 @@ for n in [15,20,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,50]:
assert m['exit_code']==0 and m['think_min_ms']==500 and m['think_mean_ms']==1000 assert m['exit_code']==0 and m['think_min_ms']==500 and m['think_mean_ms']==1000
with (folder/'measured.csv').open() as f:samples=list(csv.DictReader(f)) with (folder/'measured.csv').open() as f:samples=list(csv.DictReader(f))
rows.append({'threads':n,'run':folder.name,'cpu_percent':m['server_metrics']['192.168.1.125 CPU combined']['mean'],'mean_response_ms':statistics.mean(int(r['elapsed']) for r in samples),'requests_per_second':m['measured_http_requests_per_second'],'power_watts':m['power_energy']['average_watts'],'failed_requests':m['measured_failed_http_samples']}) rows.append({'threads':n,'run':folder.name,'cpu_percent':m['server_metrics']['192.168.1.125 CPU combined']['mean'],'mean_response_ms':statistics.mean(int(r['elapsed']) for r in samples),'requests_per_second':m['measured_http_requests_per_second'],'power_watts':m['power_energy']['average_watts'],'failed_requests':m['measured_failed_http_samples']})
with (a.output/'calibration.csv').open('w') as f:w=csv.DictWriter(f,fieldnames=list(rows[0]));w.writeheader();w.writerows(rows) with (a.output/'calibration.csv').open('w') as f:w=csv.DictWriter(f,fieldnames=list(rows[0]),lineterminator='\n');w.writeheader();w.writerows(rows)
def cpu_trace(name,filename): def cpu_trace(name,filename):
folder=a.results/name;m=json.loads((folder/'run.json').read_text()) folder=a.results/name;m=json.loads((folder/'run.json').read_text())
with (folder/'perfmon.csv').open() as f:trace=[{'timestamp_ms':int(r['timeStamp']),'cpu_percent':float(r['elapsed'])/1000} for r in csv.DictReader(f) if r['label'].endswith(' CPU combined') and r['success']=='true' and m['measurement_start_ms']<=int(r['timeStamp'])<m['measurement_end_ms']] with (folder/'perfmon.csv').open() as f:trace=[{'timestamp_ms':int(r['timeStamp']),'cpu_percent':float(r['elapsed'])/1000} for r in csv.DictReader(f) if r['label'].endswith(' CPU combined') and r['success']=='true' and m['measurement_start_ms']<=int(r['timeStamp'])<m['measurement_end_ms']]
with (a.output/filename).open('w') as f:w=csv.DictWriter(f,fieldnames=['timestamp_ms','cpu_percent']);w.writeheader();w.writerows(trace) with (a.output/filename).open('w') as f:w=csv.DictWriter(f,fieldnames=['timestamp_ms','cpu_percent'],lineterminator='\n');w.writeheader();w.writerows(trace)
return m,trace return m,trace
idle,idle_trace=cpu_trace('idle-20261008T104130Z','idle-cpu.csv') idle,idle_trace=cpu_trace('idle-20261008T104130Z','idle-cpu.csv')
selected,selected_trace=cpu_trace('capacity-shared-26-human-delay-run1','selected-cpu.csv') selected,selected_trace=cpu_trace('capacity-shared-26-human-delay-run1','selected-cpu.csv')
@@ -29,6 +29,7 @@ summary={'idle_run':'idle-20261008T104130Z','selected_run':'capacity-shared-26-h
(a.output/'evidence-summary.json').write_text(json.dumps(summary,indent=2)) (a.output/'evidence-summary.json').write_text(json.dumps(summary,indent=2))
def save(fig,name): def save(fig,name):
fig.savefig(a.output/(name+'.png'),dpi=170);fig.savefig(a.output/(name+'.svg'));plt.close(fig) fig.savefig(a.output/(name+'.png'),dpi=170);fig.savefig(a.output/(name+'.svg'));plt.close(fig)
svg=a.output/(name+'.svg');svg.write_text('\n'.join(line.rstrip() for line in svg.read_text().splitlines())+'\n')
fig,axes=plt.subplots(1,2,figsize=(13,5),layout='constrained') fig,axes=plt.subplots(1,2,figsize=(13,5),layout='constrained')
for ax,xfield,xlabel in [(axes[0],'threads','Concurrent threads'),(axes[1],'cpu_percent','Mean whole-machine CPU utilisation (%)')]: for ax,xfield,xlabel in [(axes[0],'threads','Concurrent threads'),(axes[1],'cpu_percent','Mean whole-machine CPU utilisation (%)')]:
ax.plot([r[xfield] for r in rows],[r['mean_response_ms'] for r in rows],'o-',markersize=4,label='Measured mean response time') ax.plot([r[xfield] for r in rows],[r['mean_response_ms'] for r in rows],'o-',markersize=4,label='Measured mean response time')
@@ -1,20 +1,20 @@
threads,run,cpu_percent,mean_response_ms,requests_per_second,power_watts,failed_requests threads,run,cpu_percent,mean_response_ms,requests_per_second,power_watts,failed_requests
15,capacity-shared-15-human-delay-run1,50.895801666666664,79.34052499101043,13.905,7.311085382211325,0 15,capacity-shared-15-human-delay-run1,50.895801666666664,79.34052499101043,13.905,7.311085382211325,0
20,capacity-shared-20-human-delay-run1,65.083935,98.86954928545255,18.19333333333333,8.0890766215625,0 20,capacity-shared-20-human-delay-run1,65.083935,98.86954928545255,18.19333333333333,8.0890766215625,0
25,capacity-shared-25-human-delay-run1,78.16213333333333,128.36280189601987,22.151666666666667,8.764036898464678,0 25,capacity-shared-25-human-delay-run1,78.16213333333333,128.36280189601987,22.151666666666667,8.764036898464678,0
26,capacity-shared-26-human-delay-run1,80.60345333333333,139.38706613080015,22.808333333333334,8.899511694113961,0 26,capacity-shared-26-human-delay-run1,80.60345333333333,139.38706613080015,22.808333333333334,8.899511694113961,0
27,capacity-shared-27-human-delay-run1,82.96233333333333,148.47303139839818,23.515,9.036443046141601,0 27,capacity-shared-27-human-delay-run1,82.96233333333333,148.47303139839818,23.515,9.036443046141601,0
28,capacity-shared-28-human-delay-run1,85.14292333333333,161.7337208497682,24.085,9.17391177691059,0 28,capacity-shared-28-human-delay-run1,85.14292333333333,161.7337208497682,24.085,9.17391177691059,0
29,capacity-shared-29-human-delay-run1,87.06948666666668,173.3995543250726,24.68166666666667,9.21969683437396,0 29,capacity-shared-29-human-delay-run1,87.06948666666668,173.3995543250726,24.68166666666667,9.21969683437396,0
30,capacity-shared-30-human-delay-run2,88.99881333333333,182.9120626151013,25.34,9.337538094281125,0 30,capacity-shared-30-human-delay-run2,88.99881333333333,182.9120626151013,25.34,9.337538094281125,0
31,capacity-shared-31-human-delay-run1,90.41707833333334,205.14021541655853,25.686666666666667,9.406692395193705,0 31,capacity-shared-31-human-delay-run1,90.41707833333334,205.14021541655853,25.686666666666667,9.406692395193705,0
32,capacity-shared-32-human-delay-run1,92.08799333333333,218.39473851432928,26.22833333333333,9.47666378438836,0 32,capacity-shared-32-human-delay-run1,92.08799333333333,218.39473851432928,26.22833333333333,9.47666378438836,0
33,capacity-shared-33-human-delay-run1,93.45843666666666,237.0786376158277,26.62,9.510238336982816,0 33,capacity-shared-33-human-delay-run1,93.45843666666666,237.0786376158277,26.62,9.510238336982816,0
34,capacity-shared-34-human-delay-run1,94.94577166666667,253.21672816728167,27.1,9.625515573054285,0 34,capacity-shared-34-human-delay-run1,94.94577166666667,253.21672816728167,27.1,9.625515573054285,0
35,capacity-shared-35-human-delay-run1,95.64982,279.99633900787114,27.315,9.653541583333334,0 35,capacity-shared-35-human-delay-run1,95.64982,279.99633900787114,27.315,9.653541583333334,0
36,capacity-shared-36-human-delay-run1,96.68018166666666,308.8980768064066,27.471666666666668,9.700332333333334,0 36,capacity-shared-36-human-delay-run1,96.68018166666666,308.8980768064066,27.471666666666668,9.700332333333334,0
37,capacity-shared-37-human-delay-run1,97.42113666666667,338.35063367531683,27.616666666666667,9.73826068038247,0 37,capacity-shared-37-human-delay-run1,97.42113666666667,338.35063367531683,27.616666666666667,9.73826068038247,0
38,capacity-shared-38-human-delay-run1,97.793315,381.2771442436006,27.476666666666667,9.750565151409038,0 38,capacity-shared-38-human-delay-run1,97.793315,381.2771442436006,27.476666666666667,9.750565151409038,0
39,capacity-shared-39-human-delay-run1,98.11210833333334,415.07466844304486,27.52166666666667,9.74681905188326,0 39,capacity-shared-39-human-delay-run1,98.11210833333334,415.07466844304486,27.52166666666667,9.74681905188326,0
40,capacity-shared-40-human-delay-run1,98.25498333333333,424.66961792144514,28.048333333333332,9.748927936868148,0 40,capacity-shared-40-human-delay-run1,98.25498333333333,424.66961792144514,28.048333333333332,9.748927936868148,0
50,capacity-shared-50-human-delay-run1,98.71679666666667,784.9196039840162,27.945,9.807314705581957,0 50,capacity-shared-50-human-delay-run1,98.71679666666667,784.9196039840162,27.945,9.807314705581957,0
1 threads run cpu_percent mean_response_ms requests_per_second power_watts failed_requests
2 15 capacity-shared-15-human-delay-run1 50.895801666666664 79.34052499101043 13.905 7.311085382211325 0
3 20 capacity-shared-20-human-delay-run1 65.083935 98.86954928545255 18.19333333333333 8.0890766215625 0
4 25 capacity-shared-25-human-delay-run1 78.16213333333333 128.36280189601987 22.151666666666667 8.764036898464678 0
5 26 capacity-shared-26-human-delay-run1 80.60345333333333 139.38706613080015 22.808333333333334 8.899511694113961 0
6 27 capacity-shared-27-human-delay-run1 82.96233333333333 148.47303139839818 23.515 9.036443046141601 0
7 28 capacity-shared-28-human-delay-run1 85.14292333333333 161.7337208497682 24.085 9.17391177691059 0
8 29 capacity-shared-29-human-delay-run1 87.06948666666668 173.3995543250726 24.68166666666667 9.21969683437396 0
9 30 capacity-shared-30-human-delay-run2 88.99881333333333 182.9120626151013 25.34 9.337538094281125 0
10 31 capacity-shared-31-human-delay-run1 90.41707833333334 205.14021541655853 25.686666666666667 9.406692395193705 0
11 32 capacity-shared-32-human-delay-run1 92.08799333333333 218.39473851432928 26.22833333333333 9.47666378438836 0
12 33 capacity-shared-33-human-delay-run1 93.45843666666666 237.0786376158277 26.62 9.510238336982816 0
13 34 capacity-shared-34-human-delay-run1 94.94577166666667 253.21672816728167 27.1 9.625515573054285 0
14 35 capacity-shared-35-human-delay-run1 95.64982 279.99633900787114 27.315 9.653541583333334 0
15 36 capacity-shared-36-human-delay-run1 96.68018166666666 308.8980768064066 27.471666666666668 9.700332333333334 0
16 37 capacity-shared-37-human-delay-run1 97.42113666666667 338.35063367531683 27.616666666666667 9.73826068038247 0
17 38 capacity-shared-38-human-delay-run1 97.793315 381.2771442436006 27.476666666666667 9.750565151409038 0
18 39 capacity-shared-39-human-delay-run1 98.11210833333334 415.07466844304486 27.52166666666667 9.74681905188326 0
19 40 capacity-shared-40-human-delay-run1 98.25498333333333 424.66961792144514 28.048333333333332 9.748927936868148 0
20 50 capacity-shared-50-human-delay-run1 98.71679666666667 784.9196039840162 27.945 9.807314705581957 0
File diff suppressed because it is too large. Load diff

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 49 KiB

File diff suppressed because it is too large. Load diff

Before

Width:  |  Height:  |  Size: 289 KiB

After

Width:  |  Height:  |  Size: 278 KiB

File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 82 KiB

File diff suppressed because it is too large. Load diff

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 58 KiB

File diff suppressed because it is too large. Load diff