From 9b4f1237ce19e10314b5e9b2e36c58c17f516a67 Mon Sep 17 00:00:00 2001
From: Hunter Schuler <schuler.hunter.l@gmail.com>
Date: Thu, 1 Oct 2020 12:15:15 -0400
Subject: [PATCH] [lloidhandler.py] Implement pipeline latency monitoring for
 stages using all ifos

---
 gstlal-inspiral/python/lloidhandler.py | 9 ++++++---
 gstlal-inspiral/python/lloidparts.py   | 1 +
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/gstlal-inspiral/python/lloidhandler.py b/gstlal-inspiral/python/lloidhandler.py
index 62d1988e23..f4ce9dc280 100644
--- a/gstlal-inspiral/python/lloidhandler.py
+++ b/gstlal-inspiral/python/lloidhandler.py
@@ -664,9 +664,12 @@ class LatencyTracker(object):
 		self.verbose = verbose
 
 		# recent pipeline stage latencies
-		pipeline_stages = ["datasource", "whitening", "snrSlice"]
-		self.pipeline_history = {stage: {instrument: deque(maxlen = 20) for instrument in instruments} for stage in pipeline_stages}
-
+		ifo_pipe_stages = ["datasource", "whitening", "snrSlice"]
+		all_ifo_stages = ["itacac"]
+		self.pipeline_history = {stage: {instrument: deque(maxlen = 20) for instrument in instruments} for stage in ifo_pipe_stages}
+		for stage in all_ifo_stages:
+			self.pipeline_history[stage] = {"all": deque(maxlen = 20)}
+		
 		# iterate over pipeline stages, look for the
 		# stage element that should provide the latencies, and
 		# connect handlers to collect the latencies
diff --git a/gstlal-inspiral/python/lloidparts.py b/gstlal-inspiral/python/lloidparts.py
index a55a3ea4c2..10f00b0dac 100644
--- a/gstlal-inspiral/python/lloidparts.py
+++ b/gstlal-inspiral/python/lloidparts.py
@@ -729,6 +729,7 @@ def mkLLOIDmulti(pipeline, detectors, banks, psd, psd_fft_length = 32, ht_gate_t
 	#
 
 	assert any(itacac_dict.values())
+	itacac_dict[list(itacac_dict.keys())[0]] = pipeparts.mklatency(pipeline, itacac_dict[list(itacac_dict.keys())[0]], name = "all_itacac_latency", silent = True)
 	if verbose:
 		for bank_id, head in itacac_dict.items():
 			# FIXME Not sure why we need a queue here, but without
-- 
GitLab