summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjosef <josef@guest62.se-tug.nordu.net>2015-10-01 10:22:44 +0200
committerjosef <josef@guest62.se-tug.nordu.net>2015-10-01 10:22:44 +0200
commitac488c57bcb21c638dae32fd1f9e7e8b05606522 (patch)
tree06aa2ed1632a393b0c4fb91ad83470ce52fb5931
parentb7055a72d40b774f62ea45c26eab746423f615f5 (diff)
improving timestamp validation to prevent regression
-rwxr-xr-xmonitor/josef_monitor.py4
1 files changed, 4 insertions, 0 deletions
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")