summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBryan Sullivan <bryan.sullivan@att.com>2016-10-15 11:57:30 -0700
committerBryan Sullivan <bryan.sullivan@att.com>2016-10-15 11:57:30 -0700
commitb2ffe501d141995fd99a69664d2dfb2ec5c9f8f4 (patch)
tree740a80e56aadeb1f17c4cd527dee587c66ea081e /tests
parent1b40213efc20cfe6b7e03e773aebde07fd196783 (diff)
Correct timestamp output
JIRA: VES-1 Change-Id: I4eaf24b9b9861fb9b8a8130d94fbf90cce797e2c Signed-off-by: Bryan Sullivan <bryan.sullivan@att.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/blueprints/tosca-vnfd-hello-ves/monitor.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/blueprints/tosca-vnfd-hello-ves/monitor.py b/tests/blueprints/tosca-vnfd-hello-ves/monitor.py
index ec4a00d..d861f05 100644
--- a/tests/blueprints/tosca-vnfd-hello-ves/monitor.py
+++ b/tests/blueprints/tosca-vnfd-hello-ves/monitor.py
@@ -29,13 +29,20 @@ with open('/home/ubuntu/ves.log') as f:
while True:
line = f.readline()
if line:
-# print line,
+# print "line: ", line,
if "lastEpochMicrosec" in line:
-#....5....1....5....2....5....3....5
+#0....5....1....5....2....5....3....5....4....5....5
# "lastEpochMicrosec": 1476552393091008,
- report_time = line[34:-2]
- report_time = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(1347517370))
+# Note: the above is expected, but sometimes it's in a different position or
+# corrupted with other output for some reason...
+
+ fields = line.split( )
+ e = fields[1][0:-1]
+ if e.isdigit():
+# print "report_time: ", e, "\n"
+ report_time = time.strftime('%Y-%m-%d %H:%M:%S',
+ time.localtime(int(e)/1000000))
if "requestRate" in line:
#....5....1....5....2....5....3....5