Skip to content

Commit

Permalink
Merge pull request #126 from arawa/master
Browse files Browse the repository at this point in the history
Add max meetings participants gauge
  • Loading branch information
greenstatic authored Mar 21, 2024
2 parents 7371d8e + c3e44c4 commit 876410f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bbb-exporter/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,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)
Expand Down Expand Up @@ -129,6 +130,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 + int(meeting['listenerCount']), meetings, 0)
metric = GaugeMetricFamily('bbb_meetings_listeners',
Expand Down

0 comments on commit 876410f

Please sign in to comment.