From 9cfb7957b69fbd826f44a21149e8eb03961e8741 Mon Sep 17 00:00:00 2001 From: Peter Giacomo Lombardo Date: Thu, 28 Dec 2017 17:48:54 +0100 Subject: [PATCH] Fix thread count reporting. --- instana/meter.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/instana/meter.py b/instana/meter.py index e82dbcd1..40777317 100644 --- a/instana/meter.py +++ b/instana/meter.py @@ -235,9 +235,9 @@ def collect_metrics(self): threshold2=th[2]) thr = t.enumerate() - daemon_threads = len([tr.daemon and tr.is_alive() for tr in thr]) - alive_threads = len([not tr.daemon and tr.is_alive() for tr in thr]) - dead_threads = len([not tr.is_alive() for tr in thr]) + daemon_threads = [tr.daemon and tr.is_alive() for tr in thr].count(True) + alive_threads = [not tr.daemon and tr.is_alive() for tr in thr].count(True) + dead_threads = [not tr.is_alive() for tr in thr].count(True) m = Metrics(ru_utime=u[0] if not self.last_usage else u[0] - self.last_usage[0], ru_stime=u[1] if not self.last_usage else u[1] - self.last_usage[1],