diff options
author | Leandro Pereira <leandro@hardinfo.org> | 2020-05-10 08:34:23 -0700 |
---|---|---|
committer | Leandro Pereira <leandro@hardinfo.org> | 2020-05-10 08:34:23 -0700 |
commit | 86e3c6d468e1f996ce6a1717c395d8f637c342c6 (patch) | |
tree | 533ee2a48644f5c3855a3dd39cca9c541fee8a1d | |
parent | 9c4e1da5e7a27dc2f1ce06122148c908fe346452 (diff) |
Add simple script to populate server during transition period
-rwxr-xr-x | tools/populate.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/populate.py b/tools/populate.py new file mode 100755 index 00000000..4c9f9440 --- /dev/null +++ b/tools/populate.py @@ -0,0 +1,17 @@ +#!/usr/bin/python + +import requests +import json +import sys + +for benchmark, results in json.load(sys.stdin).items(): + for result in results: + print('Populating: %s, %s' % (benchmark, result['MachineId'])) + + if not result.get('Legacy', True): + if not 'PointerBits' in result: result['PointerBits'] = 64 + + r = requests.post('http://localhost:1234/benchmark.json', json={benchmark: result}) + if not r.ok: + raise IOError("%s %d (%s)" % (r.reason, r.status_code, r.text.strip())) + |