Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Commit

Permalink
add pre for the VA service machine name
Browse files Browse the repository at this point in the history
Signed-off-by: Pengfei Qu <pengfei.qu@intel.com>
  • Loading branch information
Pengfei Qu authored and Pengfei Qu committed Jul 26, 2019
1 parent 13ee9ae commit 46b6e08
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ad-insertion/video-analytics-service/feeder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
video_analytic_url = "http://localhost:8080/pipelines/"
timeout = 30
sleep_for_status = 0.1
machine_prefix="va"

analytic_rest_msg_template = {
"source": {
Expand All @@ -35,15 +36,15 @@
}

def send_video_analytics_fps(fps):
if fps <= 0:
if fps < 0:
return
global p
if not p:
p=Producer()
if p:
p.send(video_analytics_fps_topic, json.dumps({
"fps": fps,
"machine":socket.gethostname()[0:3],
"machine":machine_prefix+socket.gethostname()[0:3],
"time": datetime.datetime.utcnow().isoformat(),
}));

Expand Down Expand Up @@ -128,12 +129,11 @@ def process_stream(streamstring):
time.sleep(sleep_for_status)
status, fps = get_analytic_status(instanceid.strip(), pipeline)
print("VA feeder: segment status : " + status, flush=True)
send_video_analytics_fps(fps)
if status == 'COMPLETED':
send_video_analytics_fps(fps)
zk.process_end()
break
elif status == 'RUNNING':
send_video_analytics_fps(fps)
continue
elif status == 'QUEUED':
continue
Expand Down

0 comments on commit 46b6e08

Please sign in to comment.