From ac488c57bcb21c638dae32fd1f9e7e8b05606522 Mon Sep 17 00:00:00 2001 From: josef Date: Thu, 1 Oct 2015 10:22:44 +0200 Subject: improving timestamp validation to prevent regression --- monitor/josef_monitor.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'monitor/josef_monitor.py') diff --git a/monitor/josef_monitor.py b/monitor/josef_monitor.py index f7017fa..7160145 100755 --- a/monitor/josef_monitor.py +++ b/monitor/josef_monitor.py @@ -233,6 +233,10 @@ class ctlog: print ERROR_STR + "New tree smaller than previous tree (%d < %d) in %s" % \ (new["tree_size"], old["tree_size"], self.name) self.log(ERROR_STR + "New tree is smaller than old tree! Old:" + str(old) + " New:" + str(new)) + + if new["timestamp"] < old["timestamp"]: + self.log(ERROR_STR + "Regression in timestamps! Old:" + str(old) + " New:" + str(new)) + print ERROR_STR + " Regression in timestamps in " + self.name else: age = time.time() - new["timestamp"]/1000 sth_time = datetime.datetime.fromtimestamp(new['timestamp'] / 1000, UTC()).strftime("%Y-%m-%d %H:%M:%S") -- cgit v1.1