aboutsummaryrefslogtreecommitdiffstats
path: root/miss_htbt_service/htbtworker.py
diff options
context:
space:
mode:
authorSatoshi Fujii <fujii-satoshi@jp.fujitsu.com>2021-10-15 06:55:11 +0000
committerSatoshi Fujii <fujii-satoshi@jp.fujitsu.com>2021-10-21 11:47:22 +0000
commita8d624c0502c241feadcfba71ba1442b22d9908b (patch)
tree41bb96a9be8f054c81605eed6bc8bb85d82975b4 /miss_htbt_service/htbtworker.py
parent4c058689904178714211f38bc5e5e083eaffadbf (diff)
Fix microsec timestamp not properly handled
Current heartbeat service assumes lastEpochMicrosec timestamp in VES notification is represented as milli-seconds, but some devices sends micro-sec timestamp in the field. In that case, the heartbeat notification was not working due to timestamp comparison was not done properly. Signed-off-by: Satoshi Fujii <fujii-satoshi@jp.fujitsu.com> Issue-ID: DCAEGEN2-2940 Change-Id: Id7c9241de70cb3ff7ee59cf1e2c60089ff96a42b
Diffstat (limited to 'miss_htbt_service/htbtworker.py')
-rw-r--r--miss_htbt_service/htbtworker.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/miss_htbt_service/htbtworker.py b/miss_htbt_service/htbtworker.py
index 467b2b7..6fbda2d 100644
--- a/miss_htbt_service/htbtworker.py
+++ b/miss_htbt_service/htbtworker.py
@@ -125,6 +125,9 @@ def process_msg(jsfile, user_name, password, ip_address, port_num, db_name):
jitem = json.loads(item)
srcname = (jitem['event']['commonEventHeader']['sourceName'])
lastepo = (jitem['event']['commonEventHeader']['lastEpochMicrosec'])
+ # if lastEpochMicrosec looks like microsec, align it with millisec
+ if lastepo > 1000000000000000:
+ lastepo = int(lastepo / 1000)
seqnum = (jitem['event']['commonEventHeader']['sequence'])
eventName = (jitem['event']['commonEventHeader']['eventName'])
except Exception as err: