Skip to content

Commit d9a89ff

Browse files
committed
[benchmark] Use header in CSV log
Since the meaning of some columns was changed, but their overall number remained, let’s include the header in the CSV log to make it clear that we are now reporting MIN, Q1, MEDIAN, Q3, MAX, MAX_RSS, instead of the old MIN, MAX, MEAN, SD, MEDIAN, MAX_RSS format.
1 parent 397c447 commit d9a89ff

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

benchmark/scripts/Benchmark_Driver

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,15 @@ class BenchmarkDriver(object):
206206
def console_log(values):
207207
print(format(values))
208208

209-
console_log(['#', 'TEST', 'SAMPLES', 'MIN(μs)', 'Q1(μs)', # header
210-
'MEDIAN(μs)', 'Q3(μs)', 'MAX(μs)', 'MAX_RSS(B)'])
211-
212209
def result_values(r):
213210
return map(str, [r.test_num, r.name, r.num_samples, r.min,
214211
r.samples.q1, r.median, r.samples.q3, r.max,
215212
r.max_rss])
216213

217-
results = []
214+
header = ['#', 'TEST', 'SAMPLES', 'MIN(μs)', 'Q1(μs)', 'MEDIAN(μs)',
215+
'Q3(μs)', 'MAX(μs)', 'MAX_RSS(B)']
216+
console_log(header)
217+
results = [header]
218218
for test in self.tests:
219219
result = result_values(self.run_independent_samples(test))
220220
console_log(result)

benchmark/scripts/test_Benchmark_Driver.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,20 +306,21 @@ def mock_run(test):
306306
with captured_output() as (out, _):
307307
log = driver.run_and_log()
308308

309+
header = '#,TEST,SAMPLES,MIN(μs),Q1(μs),MEDIAN(μs),Q3(μs),MAX(μs),' +\
310+
'MAX_RSS(B)\n'
309311
csv_log = '3,b1,5,101,102,103,104,105,888\n'
310312
self.assertEquals(log, None)
311313
self.assertEquals(
312314
out.getvalue(),
313-
'#,TEST,SAMPLES,MIN(μs),Q1(μs),MEDIAN(μs),Q3(μs),MAX(μs),' +
314-
'MAX_RSS(B)\n' +
315+
header +
315316
csv_log +
316317
'\n' +
317318
'Total performance tests executed: 1\n')
318319

319320
with captured_output() as (out, _):
320321
log = driver.run_and_log(csv_console=False)
321322

322-
self.assertEquals(log, csv_log)
323+
self.assertEquals(log, header + csv_log)
323324
self.assertEquals(
324325
out.getvalue(),
325326
' # TEST SAMPLES MIN(μs) Q1(μs)' +

0 commit comments

Comments
 (0)