From 5764e86edce6c72e8cb802602bb8142ae5100906 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Wed, 24 Jul 2013 17:25:38 -0400 Subject: [PATCH] Remove obsolete merge-messages-logs tool. (imported from commit 7feb10e74df4b788f0f9c6ba34cf23aa7db26d11) --- tools/merge-messages-logs | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100755 tools/merge-messages-logs diff --git a/tools/merge-messages-logs b/tools/merge-messages-logs deleted file mode 100755 index 11353a73ba..0000000000 --- a/tools/merge-messages-logs +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python -import simplejson - -items_by_timestamp = {} - -def read_log_file(filename): - with open(filename, 'r') as log: - for ln in log: - m = simplejson.loads(ln) - m["timestamp"] = float(m["timestamp"]) - items_by_timestamp.setdefault(m["timestamp"], []) - items_by_timestamp[m["timestamp"]].append(m) - -read_log_file("all_messages_log.merged.2012-12-05") -read_log_file("all_messages_log.staging.humbughq.com") -read_log_file("all_messages_log.app.humbughq.com") - -with open("all_messages_log.monastery", "w") as log: - for stamp in sorted(items_by_timestamp.keys()): - for item in items_by_timestamp[stamp]: - log.write(simplejson.dumps(item) + "\n")