aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorLeandro Pereira <leandro@hardinfo.org>2020-05-10 08:34:23 -0700
committerLeandro Pereira <leandro@hardinfo.org>2020-05-10 08:34:23 -0700
commit86e3c6d468e1f996ce6a1717c395d8f637c342c6 (patch)
tree533ee2a48644f5c3855a3dd39cca9c541fee8a1d /tools
parent9c4e1da5e7a27dc2f1ce06122148c908fe346452 (diff)
Add simple script to populate server during transition period
Diffstat (limited to 'tools')
-rwxr-xr-xtools/populate.py17
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()))
+