Skip to content

Commit

Permalink
Merge branch 'master' of github.com:greenstatic/bigbluebutton-exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
greenstatic committed Mar 21, 2024
2 parents d2b5707 + 876410f commit 376f27a
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 @@ -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)
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 376f27a

Please sign in to comment.