PYTHON-2888 Migrate from json.send to perf.send (#819)

Rename ops_per_sec to bytes_per_sec to better reflect the perf measurement.
This commit is contained in:
Shane Harvey 2021-12-13 14:41:25 -08:00 committed by GitHub
parent a7891480d1
commit b2f3c66575
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 12 deletions

View File

@ -133,9 +133,8 @@ functions:
file_location: src/report.json
"send dashboard data":
- command: json.send
- command: perf.send
params:
name: perf
file: src/results.json
"cleanup":

View File

@ -47,9 +47,7 @@ OUTPUT_FILE = os.environ.get('OUTPUT_FILE')
result_data = []
def tearDownModule():
output = json.dumps({
'results': result_data
}, indent=4)
output = json.dumps(result_data, indent=4)
if OUTPUT_FILE:
with open(OUTPUT_FILE, 'w') as opf:
opf.write(output)
@ -79,16 +77,22 @@ class PerformanceTest(object):
def tearDown(self):
name = self.__class__.__name__
median = self.percentile(50)
result = self.data_size / median
bytes_per_sec = self.data_size / median
print('Running %s. MEDIAN=%s' % (self.__class__.__name__,
self.percentile(50)))
result_data.append({
'name': name,
'results': {
'1': {
'ops_per_sec': result
}
}
'info': {
'test_name': name,
'args': {
'threads': 1,
},
},
'metrics': [
{
'name': 'bytes_per_sec',
'value': bytes_per_sec
},
]
})
def before(self):