diff --git a/bbb-exporter/collector.py b/bbb-exporter/collector.py index 1150ff9..0ef05a5 100644 --- a/bbb-exporter/collector.py +++ b/bbb-exporter/collector.py @@ -70,6 +70,7 @@ def collect(self): yield self.metric_meetings(meetings) yield self.metric_participants(meetings) + yield self.metric_participants_max(meetings) yield self.metric_meetings_listeners(meetings) yield self.metric_meetings_voice_participants(meetings) yield self.metric_meetings_video_participants(meetings) @@ -139,6 +140,13 @@ def metric_participants(self, meetings): metric.add_metric([], no_participants) return metric + def metric_participants_max(self, meetings): + no_participants = reduce(lambda max, meeting: int(meeting['participantCount']) if int(meeting['participantCount']) > max else max, meetings, 0) + metric = GaugeMetricFamily('bbb_meetings_participants_max', + "Maximum number of participants in all BigBlueButton meetings") + metric.add_metric([], no_participants) + return metric + def metric_meetings_listeners(self, meetings): no_listeners = reduce(lambda total, meeting: total + str_integer_to_int(meeting['listenerCount']), meetings, 0) metric = GaugeMetricFamily('bbb_meetings_listeners',