diff --git a/main.go b/main.go index 838d278..fbc18c8 100644 --- a/main.go +++ b/main.go @@ -38,9 +38,12 @@ jitsi_jibri_available {{.JibriDetector.Available}} jitsi_jicofo_largest_conferences {{.LargestConferences}} # HELP jitsi_conference_sizes Distribution of conference sizes on jicofo # TYPE jitsi_conference_sizes gauge -{{ range $key, $value := .ConferenceSizes -}} -jitsi_conference_sizes{conference_size="{{$key}}"} {{ $value }} -{{ end -}} +jitsi_conference_sizes_total_values {{ or .ConferenceSizes.TotalValue 0 }} +jitsi_conference_sizes_total_count {{ or .ConferenceSizes.TotalCount 0 }} +jitsi_conference_sizes_total_average {{ or .ConferenceSizes.Average 0 }} +jitsi_conference_sizes_total_max {{ or .ConferenceSizes.Max 0 }} +jitsi_conference_sizes_total_min {{ or .ConferenceSizes.Min 0 }} +jitsi_conference_sizes_total_discarded {{ or .ConferenceSizes.Discarded 0 }} # HELP jitsi_total_conferences_created The total number of conferences created on jicofo. # TYPE jitsi_total_conferences_created counter jitsi_total_conferences_created {{.TotalConferencesCreated}} @@ -136,6 +139,16 @@ jitsi_conferences {{.Conferences}} jitsi_participants {{.Participants}}`)) ) +type conferenceSizes struct { + Average interface{} `json:"average"` + Max interface{} `json:"max"` + Min interface{} `json:"min"` + TotalValue interface{} `json:"total_value"` + TotalCount interface{} `json:"total_count"` + Discarded interface{} `json:"discarded"` + Buckets map[string]int `json:"buckets"` +} + // jicofoStats type jicofoStats struct { XmppService struct { @@ -148,10 +161,10 @@ type jicofoStats struct { Available int `json:"available"` } `json:"jibri_detector"` - LargestConferences int `json:"largest_conference"` - ConferenceSizes []int `json:"conference_sizes"` - TotalConferencesCreated int `json:"total_conferences_created"` - Threads int `json:"threads"` + LargestConferences int `json:"largest_conference"` + ConferenceSizes conferenceSizes `json:"conference_sizes"` + TotalConferencesCreated int `json:"total_conferences_created"` + Threads int `json:"threads"` Jingle struct { Received struct{} `json:"received"` Sent struct{} `json:"sent"`