Commit 39909a4d authored by Tomas Krizek's avatar Tomas Krizek

global_stats: save start/end time as integer timestamp

parent 60679d58
......@@ -214,7 +214,7 @@ def main():
sys.exit(1)
with lmdb.env.begin(sdb) as txn:
stats = pickle.loads(txn.get(b'global_stats'))
global_stats['duration'] = round(stats['end_time'] - stats['start_time'])
global_stats['duration'] = stats['end_time'] - stats['start_time']
print_results(global_stats, field_weights, field_stats, n=args.limit)
......
......@@ -118,7 +118,7 @@ def main():
except KeyError:
pass
stats = {
'start_time': time.time(),
'start_time': int(time.time()),
'end_time': None,
}
......@@ -148,7 +148,7 @@ def main():
# attempt to preserve data if something went wrong (or not)
txn.commit()
stats['end_time'] = time.time()
stats['end_time'] = int(time.time())
with lmdb.env.begin(sdb, write=True) as txn:
txn.put(b'global_stats', pickle.dumps(stats))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment