Skip to content
This repository was archived by the owner on Jan 28, 2022. It is now read-only.
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
18 changes: 9 additions & 9 deletions hpcbench/benchmark/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ def plots(self):
series=dict(
metas=['thread'],
metrics=[
'cpu__copy_min_time', 'cpu__copy_avg_time',
'cpu__copy_max_time', 'cpu__scale_min_time',
'cpu__scale_avg_time', 'cpu__scale_max_time',
'cpu__add_min_time', 'cpu__add_avg_time',
'cpu__add_max_time', 'cpu__triad_min_time',
'cpu__triad_avg_time', 'cpu__triad_max_time',
'copy_min_time', 'copy_avg_time',
'copy_max_time', 'scale_min_time',
'scale_avg_time', 'scale_max_time',
'add_min_time', 'add_avg_time',
'add_max_time', 'triad_min_time',
'triad_avg_time', 'triad_max_time',
],

),
Expand All @@ -189,11 +189,11 @@ def plot_timing(cls, plt, description, metas, metrics):
"""Generate timings plot
"""
del description # unused
plt.plot(metas['threads'], metrics['cpu__copy_min_time'],
plt.plot(metas['threads'], metrics['copy_min_time'],
'bs-', label='minimum')
plt.plot(metas['threads'], metrics['cpu__copy_avg_time'],
plt.plot(metas['threads'], metrics['copy_avg_time'],
'g^', label='average')
plt.plot(metas['threads'], metrics['cpu__copy_max_time'],
plt.plot(metas['threads'], metrics['copy_max_time'],
'g^', label='maximum')
plt.legend(loc='upper right', frameon=False)
plt.xlabel('thread')
Expand Down
4 changes: 2 additions & 2 deletions hpcbench/benchmark/sysbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ def plots(self):
),
series=dict(
metas=['-threads'],
metrics=['cpu__minimum', 'cpu__average',
'cpu__maximum', 'cpu__percentile95'],
metrics=['minimum', 'average',
'maximum', 'percentile95'],
),
plotter=Sysbench.plot_timing
),
Expand Down
10 changes: 1 addition & 9 deletions hpcbench/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,13 +362,6 @@ def gather_metrics(self, runs):
data.pop('category', None)
data.pop('command', None)
data['id'] = run_dirs[i]
gathered_metrics = dict()
for cat, metricss in data.get('metrics', {}).items():
gathered = dict()
for metrics in metricss:
gathered.update(metrics)
gathered_metrics[cat] = gathered
data['metrics'] = gathered_metrics
json.dump(data, ostr, indent=2)
if i != len(run_dirs) - 1:
ostr.write(',')
Expand Down Expand Up @@ -417,8 +410,7 @@ def __call__(self, **kwargs):
for extractor in extractors:
run_metrics = extractor.extract(os.getcwd(),
self.report.get('metas'))
MetricsDriver._check_metrics(extractor, run_metrics)
metrics.setdefault(cat, []).append(run_metrics)
metrics.update(run_metrics)
return self.report

@classmethod
Expand Down
8 changes: 4 additions & 4 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ def plots(self):
series=dict(
metas=['field'],
metrics=[
'main__performance',
'main__standard_error'
'performance',
'standard_error'
],
),
plotter=self.plot_performance
Expand All @@ -109,6 +109,6 @@ def plots(self):

def plot_performance(self, plt, description, metas, metrics):
plt.errorbar(metas['field'],
metrics['main__performance'],
yerr=metrics['main__standard_error'],
metrics['performance'],
yerr=metrics['standard_error'],
fmt='o', ecolor='g', capthick=2)
6 changes: 1 addition & 5 deletions tests/benchmark/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,7 @@ def check_category_metrics(self, category):
md = MetricsDriver('test-category', benchmark)
report = md()
parsed_metrics = report.get('metrics', {})
expected_metrics = {
category: [
self.get_expected_metrics(category)
]
}
expected_metrics = self.get_expected_metrics(category)
assert parsed_metrics == expected_metrics

def test_has_description(self):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ def test_03_plot(self):
'*',
'test01',
'main',
'91859462124ccb92b82125a312b1ff3d10'
'86fe44b668f96eddc073e3e4e37204.png'
'7b9d424b038a9c89bf48c0b183864e61b1'
'724a109b8f2d9d756b594f8f29b861.png'
)
self.assertTrue(osp.isfile(plot_file_f))

Expand Down