From b2ffe501d141995fd99a69664d2dfb2ec5c9f8f4 Mon Sep 17 00:00:00 2001 From: Bryan Sullivan Date: Sat, 15 Oct 2016 11:57:30 -0700 Subject: Correct timestamp output JIRA: VES-1 Change-Id: I4eaf24b9b9861fb9b8a8130d94fbf90cce797e2c Signed-off-by: Bryan Sullivan --- tests/blueprints/tosca-vnfd-hello-ves/monitor.py | 15 +++++++++++---- 1 file 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 -- cgit 1.2.3-korg