diff --git a/main.go b/main.go index 838d278..46dd9a5 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_average {{ or .ConferenceSizes.Average 0 }} +jitsi_conference_sizes_max {{ or .ConferenceSizes.Max 0 }} +jitsi_conference_sizes_min {{ or .ConferenceSizes.Min 0 }} +jitsi_conference_sizes_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"` diff --git a/main_test.go b/main_test.go index 5b31b6c..dfdd5ee 100644 --- a/main_test.go +++ b/main_test.go @@ -26,52 +26,36 @@ func TestGetMetrics(t *testing.T) { expected string }{ { // no participant - statsJson: `{"xmpp_service":{"total_recv":100,"total_sent":100},"jibri_detector":{"count":1,"available":1},"largest_conference":0,"conference_sizes":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"total_conferences_created":1,"threads":222,"xmpp":{},"jingle":{"received":{},"sent":{}},"bridge_failures":{"participants_moved":0,"bridges_removed":0},"avg_allocate_channels_req_time_nanos":0.0,"total_participants":1,"participant_notifications":{"ice_failed":0,"request_restart":0},"bridge_selector":{"total_least_loaded_in_region":0,"total_split_due_to_load":0,"lost_bridges":0,"total_not_loaded_in_region_in_conference":0,"in_shutdown_bridge_count":0,"total_least_loaded_in_region_in_conference":0,"total_not_loaded_in_region":0,"total_split_due_to_region":0,"bridge_count":1,"operational_bridge_count":1,"total_least_loaded_in_conference":0,"total_least_loaded":0},"jibri":{"total_sip_call_failures":0,"live_streaming_pending":0,"recording_pending":0,"live_streaming_active":0,"total_recording_failures":0,"sip_call_pending":0,"sip_call_active":0,"total_live_streaming_failures":0,"recording_active":0},"conferences":0,"participants":0,"slow_health_check":2}`, + statsJson: `{"jibri_detector":{"count":3,"available":3},"largest_conference":0,"conference_sizes":{"average":null,"max":0,"min":0,"total_value":0,"total_count":0,"discarded":0,"buckets":{"0_to_1":0,"1_to_2":0,"2_to_3":0,"3_to_5":0,"5_to_10":0,"10_to_20":0,"20_to_50":0,"50_to_100":0,"100_to_200":0,"200_to_300":0,"300_to_400":0,"400_to_500":0,"500_to_max":0,"p99_upper_bound":-1,"p999_upper_bound":-1}},"total_conferences_created":3,"threads":30,"jingle":{"received":{"transport-info":15,"session-accept":15},"sent":{"session-initiate":15,"session-terminate":1,"source-add":28}},"bridge_failures":{"participants_moved":0},"total_participants":15,"participant_notifications":{"ice_failed":0,"request_restart":0},"queues":{"jibri-iq-queue":{"added_packets":4,"removed_packets":4,"dropped_packets":0,"duration_s":64686.453447,"average_remove_rate_pps":6.183674922412229E-5,"queue_size_at_remove":{"average_queue_size_at_remove":0.0,"max_queue_size_at_remove":0,"min_queue_size_at_remove":0,"total_value":0,"total_count":4,"discarded":0,"buckets":{"0_to_1":4,"1_to_4":0,"4_to_16":0,"16_to_64":0,"64_to_256":0,"256_to_1024":0,"1024_to_4096":0,"4096_to_16384":0,"16384_to_max":0,"p99_upper_bound":-1,"p999_upper_bound":-1}}}},"jigasi":{},"healthy":true,"bridge_selector":{"total_least_loaded_in_region_group":0,"lost_bridges":6,"total_not_loaded_in_region_in_conference":7,"in_shutdown_bridge_count":0,"total_not_loaded_in_region_group":0,"operational_bridge_count":3,"total_not_loaded_in_region_group_in_conference":0,"total_least_loaded_in_region_group_in_conference":0,"total_least_loaded":3,"total_least_loaded_in_region":0,"total_split_due_to_load":5,"total_least_loaded_in_region_in_conference":0,"total_not_loaded_in_region":5,"total_split_due_to_region":0,"bridge_count":3,"total_least_loaded_in_conference":0},"jibri":{"total_sip_call_failures":0,"live_streaming_pending":0,"recording_pending":0,"live_streaming_active":0,"total_recording_failures":0,"sip_call_pending":0,"sip_call_active":0,"total_live_streaming_failures":0,"recording_active":0},"endpoint_pairs":0,"conferences":0,"participants":0,"slow_health_check":0}`, expected: `# HELP xmpp_service_total_recv stats about xmpp_service. # TYPE xmpp_service_total_recv counter -jitsi_xmpp_service_total_recv 100 +jitsi_xmpp_service_total_recv 0 # HELP xmpp_service_total_sent stats about xmpp_service. # TYPE xmpp_service_total_sent counter -jitsi_xmpp_service_total_sent 100 +jitsi_xmpp_service_total_sent 0 # HELP total jibris registered. # TYPE jibri_count gauge -jitsi_jibri_count 1 +jitsi_jibri_count 3 # HELP total jibri available stats. # TYPE jibri_available gauge -jitsi_jibri_available 1 +jitsi_jibri_available 3 # HELP jicofo largest_conferences stats. # TYPE largest_conference_jicofo_stats gauge jitsi_jicofo_largest_conferences 0 # HELP jitsi_conference_sizes Distribution of conference sizes on jicofo # TYPE jitsi_conference_sizes gauge -jitsi_conference_sizes{conference_size="0"} 0 -jitsi_conference_sizes{conference_size="1"} 0 -jitsi_conference_sizes{conference_size="2"} 0 -jitsi_conference_sizes{conference_size="3"} 0 -jitsi_conference_sizes{conference_size="4"} 0 -jitsi_conference_sizes{conference_size="5"} 0 -jitsi_conference_sizes{conference_size="6"} 0 -jitsi_conference_sizes{conference_size="7"} 0 -jitsi_conference_sizes{conference_size="8"} 0 -jitsi_conference_sizes{conference_size="9"} 0 -jitsi_conference_sizes{conference_size="10"} 0 -jitsi_conference_sizes{conference_size="11"} 0 -jitsi_conference_sizes{conference_size="12"} 0 -jitsi_conference_sizes{conference_size="13"} 0 -jitsi_conference_sizes{conference_size="14"} 0 -jitsi_conference_sizes{conference_size="15"} 0 -jitsi_conference_sizes{conference_size="16"} 0 -jitsi_conference_sizes{conference_size="17"} 0 -jitsi_conference_sizes{conference_size="18"} 0 -jitsi_conference_sizes{conference_size="19"} 0 -jitsi_conference_sizes{conference_size="20"} 0 -jitsi_conference_sizes{conference_size="21"} 0 +jitsi_conference_sizes_total_values 0 +jitsi_conference_sizes_total_count 0 +jitsi_conference_sizes_average 0 +jitsi_conference_sizes_max 0 +jitsi_conference_sizes_min 0 +jitsi_conference_sizes_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 1 +jitsi_total_conferences_created 3 # HELP jitsi_threads_on_jicofo Threads count on jicofo # TYPE jitsi_jicofo_thread gauge -jitsi_jicofo_threads 222 +jitsi_jicofo_threads 30 # HELP jitsi_birdge_failure_participants_moved Participants moved after bridge failure # TYPE jitsi_bridge_failure_participants_moved gauge jitsi_bridge_failure_participants_moved 0 @@ -83,7 +67,7 @@ jitsi_bridge_failure_bridge_removed 0 jitsi_avg_allocate_channels_req_time_nanos 0 # HELP jitsi_total_participants Total number of participants joined so far. # TYPE jitsi_total_participants counter -jitsi_total_participants 1 +jitsi_total_participants 15 # HELP jitsi_participants_notification_ice_failed Stats about ice failure. # TYPE jitsi_participants_notification_ice_failed counter jitsi_participants_notification_ice_failed 0 @@ -95,13 +79,13 @@ jitsi_participants_notification_request_restart 0 jitsi_bridge_selector_total_least_loaded_in_region 0 # HELP jitsi_bridge_selector_total_split_due_to_load Bridges splitted due to load. # TYPE jitsi_bridge_selector_total_split_due_to_load gauge -jitsi_bridge_selector_total_split_due_to_load 0 +jitsi_bridge_selector_total_split_due_to_load 5 # HELP jitsi_bridge_selector_lost_bridges bridges lost because of some reasons # TYPE jitsi_bridge_selector_lost_bridges gauge -jitsi_bridge_selector_lost_bridges 0 +jitsi_bridge_selector_lost_bridges 6 # HELP jitsi_total_not_loaded_in_region_in_conference Bridges not loaded in a region in a conference. # TYPE jitsi_bridge_selector_total_not_loaded_in_region_in_conference gauge -jitsi_bridge_selector_total_not_loaded_in_region_in_conference 0 +jitsi_bridge_selector_total_not_loaded_in_region_in_conference 7 # HELP jitsi_in_shutdown_bridge_count Bridges count that are in shutdown. # TYPE jitsi_bridge_selector_in_shutdown_bridge_count gauge jitsi_bridge_selector_in_shutdown_bridge_count 0 @@ -110,22 +94,22 @@ jitsi_bridge_selector_in_shutdown_bridge_count 0 jitsi_bridge_selector_total_least_loaded_in_region_in_conference 0 # HELP jitsi_total_not_loaded_in_region Bridges that are not loaded in a region. # TYPE jitsi_bridge_selector_total_not_loaded_in_region gauge -jitsi_bridge_selector_total_not_loaded_in_region 0 +jitsi_bridge_selector_total_not_loaded_in_region 5 # HELP jitsi_total_split_due_to_region Bridges splitted due to region. # TYPE jitsi_bridge_selector_total_not_loaded_in_region gauge jitsi_bridge_selector_total_split_due_to_region 0 # HELP jitsi_bridge_count Number of bridges registered. # TYPE jitsi_bridge_count gauge -jitsi_bridge_count 1 +jitsi_bridge_count 3 # HELP jitsi_operational_bridge_count Bridges that are operational. # TYPE jitsi_operational_bridge_count gauge -jitsi_operational_bridge_count 1 +jitsi_operational_bridge_count 3 # HELP jitsi_total_least_loaded_in_conference Bridges that are least loaded in a conference. # TYPE jitsi_total_least_loaded_in_conference gauge jitsi_total_least_loaded_in_conference 0 # HELP jitsi_total_least_loaded Bridges that are least loaded. # TYPE jitsi_total_least_loaded gauge -jitsi_total_least_loaded 0 +jitsi_total_least_loaded 3 # HELP jitsi_total_sip_call_failures Total Sip call failures. # TYPE jitsi_total_least_loaded counter jitsi_total_sip_call_failures 0 @@ -161,52 +145,36 @@ jitsi_conferences 0 jitsi_participants 0`, }, { // 1 participant - statsJson: `{"xmpp_service":{"total_recv":1000,"total_sent":1000},"jibri_detector":{"count":1,"available":1},"largest_conference":1,"conference_sizes":[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"total_conferences_created":2,"threads":222,"xmpp":{},"jingle":{"received":{},"sent":{}},"bridge_failures":{"participants_moved":0,"bridges_removed":0},"avg_allocate_channels_req_time_nanos":0.0,"total_participants":2,"participant_notifications":{"ice_failed":0,"request_restart":0},"bridge_selector":{"total_least_loaded_in_region":0,"total_split_due_to_load":0,"lost_bridges":0,"total_not_loaded_in_region_in_conference":0,"in_shutdown_bridge_count":0,"total_least_loaded_in_region_in_conference":0,"total_not_loaded_in_region":0,"total_split_due_to_region":0,"bridge_count":1,"operational_bridge_count":1,"total_least_loaded_in_conference":0,"total_least_loaded":0},"jibri":{"total_sip_call_failures":0,"live_streaming_pending":0,"recording_pending":0,"live_streaming_active":0,"total_recording_failures":0,"sip_call_pending":0,"sip_call_active":0,"total_live_streaming_failures":0,"recording_active":0},"conferences":1,"participants":1,"slow_health_check":2}`, + statsJson: `{"jibri_detector":{"count":3,"available":3},"largest_conference":0,"conference_sizes":{"average":null,"max":0,"min":0,"total_value":0,"total_count":0,"discarded":0,"buckets":{"0_to_1":0,"1_to_2":0,"2_to_3":0,"3_to_5":0,"5_to_10":0,"10_to_20":0,"20_to_50":0,"50_to_100":0,"100_to_200":0,"200_to_300":0,"300_to_400":0,"400_to_500":0,"500_to_max":0,"p99_upper_bound":-1,"p999_upper_bound":-1}},"total_conferences_created":3,"threads":30,"jingle":{"received":{"transport-info":15,"session-accept":15},"sent":{"session-initiate":15,"session-terminate":1,"source-add":28}},"bridge_failures":{"participants_moved":0},"total_participants":15,"participant_notifications":{"ice_failed":0,"request_restart":0},"queues":{"jibri-iq-queue":{"added_packets":4,"removed_packets":4,"dropped_packets":0,"duration_s":64686.453447,"average_remove_rate_pps":6.183674922412229E-5,"queue_size_at_remove":{"average_queue_size_at_remove":0.0,"max_queue_size_at_remove":0,"min_queue_size_at_remove":0,"total_value":0,"total_count":4,"discarded":0,"buckets":{"0_to_1":4,"1_to_4":0,"4_to_16":0,"16_to_64":0,"64_to_256":0,"256_to_1024":0,"1024_to_4096":0,"4096_to_16384":0,"16384_to_max":0,"p99_upper_bound":-1,"p999_upper_bound":-1}}}},"jigasi":{},"healthy":true,"bridge_selector":{"total_least_loaded_in_region_group":0,"lost_bridges":6,"total_not_loaded_in_region_in_conference":7,"in_shutdown_bridge_count":0,"total_not_loaded_in_region_group":0,"operational_bridge_count":3,"total_not_loaded_in_region_group_in_conference":0,"total_least_loaded_in_region_group_in_conference":0,"total_least_loaded":3,"total_least_loaded_in_region":0,"total_split_due_to_load":5,"total_least_loaded_in_region_in_conference":0,"total_not_loaded_in_region":5,"total_split_due_to_region":0,"bridge_count":3,"total_least_loaded_in_conference":0},"jibri":{"total_sip_call_failures":0,"live_streaming_pending":0,"recording_pending":0,"live_streaming_active":0,"total_recording_failures":0,"sip_call_pending":0,"sip_call_active":0,"total_live_streaming_failures":0,"recording_active":0},"endpoint_pairs":0,"conferences":0,"participants":1,"slow_health_check":0}`, expected: `# HELP xmpp_service_total_recv stats about xmpp_service. # TYPE xmpp_service_total_recv counter -jitsi_xmpp_service_total_recv 1000 +jitsi_xmpp_service_total_recv 0 # HELP xmpp_service_total_sent stats about xmpp_service. # TYPE xmpp_service_total_sent counter -jitsi_xmpp_service_total_sent 1000 +jitsi_xmpp_service_total_sent 0 # HELP total jibris registered. # TYPE jibri_count gauge -jitsi_jibri_count 1 +jitsi_jibri_count 3 # HELP total jibri available stats. # TYPE jibri_available gauge -jitsi_jibri_available 1 +jitsi_jibri_available 3 # HELP jicofo largest_conferences stats. # TYPE largest_conference_jicofo_stats gauge -jitsi_jicofo_largest_conferences 1 +jitsi_jicofo_largest_conferences 0 # HELP jitsi_conference_sizes Distribution of conference sizes on jicofo # TYPE jitsi_conference_sizes gauge -jitsi_conference_sizes{conference_size="0"} 0 -jitsi_conference_sizes{conference_size="1"} 1 -jitsi_conference_sizes{conference_size="2"} 0 -jitsi_conference_sizes{conference_size="3"} 0 -jitsi_conference_sizes{conference_size="4"} 0 -jitsi_conference_sizes{conference_size="5"} 0 -jitsi_conference_sizes{conference_size="6"} 0 -jitsi_conference_sizes{conference_size="7"} 0 -jitsi_conference_sizes{conference_size="8"} 0 -jitsi_conference_sizes{conference_size="9"} 0 -jitsi_conference_sizes{conference_size="10"} 0 -jitsi_conference_sizes{conference_size="11"} 0 -jitsi_conference_sizes{conference_size="12"} 0 -jitsi_conference_sizes{conference_size="13"} 0 -jitsi_conference_sizes{conference_size="14"} 0 -jitsi_conference_sizes{conference_size="15"} 0 -jitsi_conference_sizes{conference_size="16"} 0 -jitsi_conference_sizes{conference_size="17"} 0 -jitsi_conference_sizes{conference_size="18"} 0 -jitsi_conference_sizes{conference_size="19"} 0 -jitsi_conference_sizes{conference_size="20"} 0 -jitsi_conference_sizes{conference_size="21"} 0 +jitsi_conference_sizes_total_values 0 +jitsi_conference_sizes_total_count 0 +jitsi_conference_sizes_average 0 +jitsi_conference_sizes_max 0 +jitsi_conference_sizes_min 0 +jitsi_conference_sizes_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 2 +jitsi_total_conferences_created 3 # HELP jitsi_threads_on_jicofo Threads count on jicofo # TYPE jitsi_jicofo_thread gauge -jitsi_jicofo_threads 222 +jitsi_jicofo_threads 30 # HELP jitsi_birdge_failure_participants_moved Participants moved after bridge failure # TYPE jitsi_bridge_failure_participants_moved gauge jitsi_bridge_failure_participants_moved 0 @@ -218,7 +186,7 @@ jitsi_bridge_failure_bridge_removed 0 jitsi_avg_allocate_channels_req_time_nanos 0 # HELP jitsi_total_participants Total number of participants joined so far. # TYPE jitsi_total_participants counter -jitsi_total_participants 2 +jitsi_total_participants 15 # HELP jitsi_participants_notification_ice_failed Stats about ice failure. # TYPE jitsi_participants_notification_ice_failed counter jitsi_participants_notification_ice_failed 0 @@ -230,13 +198,13 @@ jitsi_participants_notification_request_restart 0 jitsi_bridge_selector_total_least_loaded_in_region 0 # HELP jitsi_bridge_selector_total_split_due_to_load Bridges splitted due to load. # TYPE jitsi_bridge_selector_total_split_due_to_load gauge -jitsi_bridge_selector_total_split_due_to_load 0 +jitsi_bridge_selector_total_split_due_to_load 5 # HELP jitsi_bridge_selector_lost_bridges bridges lost because of some reasons # TYPE jitsi_bridge_selector_lost_bridges gauge -jitsi_bridge_selector_lost_bridges 0 +jitsi_bridge_selector_lost_bridges 6 # HELP jitsi_total_not_loaded_in_region_in_conference Bridges not loaded in a region in a conference. # TYPE jitsi_bridge_selector_total_not_loaded_in_region_in_conference gauge -jitsi_bridge_selector_total_not_loaded_in_region_in_conference 0 +jitsi_bridge_selector_total_not_loaded_in_region_in_conference 7 # HELP jitsi_in_shutdown_bridge_count Bridges count that are in shutdown. # TYPE jitsi_bridge_selector_in_shutdown_bridge_count gauge jitsi_bridge_selector_in_shutdown_bridge_count 0 @@ -245,22 +213,22 @@ jitsi_bridge_selector_in_shutdown_bridge_count 0 jitsi_bridge_selector_total_least_loaded_in_region_in_conference 0 # HELP jitsi_total_not_loaded_in_region Bridges that are not loaded in a region. # TYPE jitsi_bridge_selector_total_not_loaded_in_region gauge -jitsi_bridge_selector_total_not_loaded_in_region 0 +jitsi_bridge_selector_total_not_loaded_in_region 5 # HELP jitsi_total_split_due_to_region Bridges splitted due to region. # TYPE jitsi_bridge_selector_total_not_loaded_in_region gauge jitsi_bridge_selector_total_split_due_to_region 0 # HELP jitsi_bridge_count Number of bridges registered. # TYPE jitsi_bridge_count gauge -jitsi_bridge_count 1 +jitsi_bridge_count 3 # HELP jitsi_operational_bridge_count Bridges that are operational. # TYPE jitsi_operational_bridge_count gauge -jitsi_operational_bridge_count 1 +jitsi_operational_bridge_count 3 # HELP jitsi_total_least_loaded_in_conference Bridges that are least loaded in a conference. # TYPE jitsi_total_least_loaded_in_conference gauge jitsi_total_least_loaded_in_conference 0 # HELP jitsi_total_least_loaded Bridges that are least loaded. # TYPE jitsi_total_least_loaded gauge -jitsi_total_least_loaded 0 +jitsi_total_least_loaded 3 # HELP jitsi_total_sip_call_failures Total Sip call failures. # TYPE jitsi_total_least_loaded counter jitsi_total_sip_call_failures 0 @@ -290,58 +258,42 @@ jitsi_total_live_streaming_failures 0 jitsi_recording_active 0 # HELP jitsi_conferences Current running conferences. # TYPE jitsi_conferences gauge -jitsi_conferences 1 +jitsi_conferences 0 # HELP jitsi_participants Current participants. # TYPE jitsi_participants gauge jitsi_participants 1`, }, { // 2 participants - statsJson: `{"xmpp_service":{"total_recv":2000,"total_sent":2000},"jibri_detector":{"count":1,"available":1},"largest_conference":2,"conference_sizes":[0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"total_conferences_created":2,"threads":224,"xmpp":{},"jingle":{"received":{"transport-info":3,"session-accept":2},"sent":{"source-add":2,"session-initiate":2}},"bridge_failures":{"participants_moved":0,"bridges_removed":0},"avg_allocate_channels_req_time_nanos":9.60278E8,"total_participants":3,"participant_notifications":{"ice_failed":0,"request_restart":0},"bridge_selector":{"total_least_loaded_in_region":0,"total_split_due_to_load":0,"lost_bridges":0,"total_not_loaded_in_region_in_conference":0,"in_shutdown_bridge_count":0,"total_least_loaded_in_region_in_conference":0,"total_not_loaded_in_region":0,"total_split_due_to_region":0,"bridge_count":1,"operational_bridge_count":1,"total_least_loaded_in_conference":0,"total_least_loaded":1},"jibri":{"total_sip_call_failures":0,"live_streaming_pending":0,"recording_pending":0,"live_streaming_active":0,"total_recording_failures":0,"sip_call_pending":0,"sip_call_active":0,"total_live_streaming_failures":0,"recording_active":0},"conferences":1,"participants":2,"slow_health_check":2}`, + statsJson: `{"jibri_detector":{"count":3,"available":3},"largest_conference":0,"conference_sizes":{"average":null,"max":0,"min":0,"total_value":0,"total_count":0,"discarded":0,"buckets":{"0_to_1":0,"1_to_2":0,"2_to_3":0,"3_to_5":0,"5_to_10":0,"10_to_20":0,"20_to_50":0,"50_to_100":0,"100_to_200":0,"200_to_300":0,"300_to_400":0,"400_to_500":0,"500_to_max":0,"p99_upper_bound":-1,"p999_upper_bound":-1}},"total_conferences_created":3,"threads":30,"jingle":{"received":{"transport-info":15,"session-accept":15},"sent":{"session-initiate":15,"session-terminate":1,"source-add":28}},"bridge_failures":{"participants_moved":0},"total_participants":15,"participant_notifications":{"ice_failed":0,"request_restart":0},"queues":{"jibri-iq-queue":{"added_packets":4,"removed_packets":4,"dropped_packets":0,"duration_s":64686.453447,"average_remove_rate_pps":6.183674922412229E-5,"queue_size_at_remove":{"average_queue_size_at_remove":0.0,"max_queue_size_at_remove":0,"min_queue_size_at_remove":0,"total_value":0,"total_count":4,"discarded":0,"buckets":{"0_to_1":4,"1_to_4":0,"4_to_16":0,"16_to_64":0,"64_to_256":0,"256_to_1024":0,"1024_to_4096":0,"4096_to_16384":0,"16384_to_max":0,"p99_upper_bound":-1,"p999_upper_bound":-1}}}},"jigasi":{},"healthy":true,"bridge_selector":{"total_least_loaded_in_region_group":0,"lost_bridges":6,"total_not_loaded_in_region_in_conference":7,"in_shutdown_bridge_count":0,"total_not_loaded_in_region_group":0,"operational_bridge_count":3,"total_not_loaded_in_region_group_in_conference":0,"total_least_loaded_in_region_group_in_conference":0,"total_least_loaded":3,"total_least_loaded_in_region":0,"total_split_due_to_load":5,"total_least_loaded_in_region_in_conference":0,"total_not_loaded_in_region":5,"total_split_due_to_region":0,"bridge_count":3,"total_least_loaded_in_conference":0},"jibri":{"total_sip_call_failures":0,"live_streaming_pending":0,"recording_pending":0,"live_streaming_active":0,"total_recording_failures":0,"sip_call_pending":0,"sip_call_active":0,"total_live_streaming_failures":0,"recording_active":0},"endpoint_pairs":0,"conferences":0,"participants":2,"slow_health_check":0}`, expected: `# HELP xmpp_service_total_recv stats about xmpp_service. # TYPE xmpp_service_total_recv counter -jitsi_xmpp_service_total_recv 2000 +jitsi_xmpp_service_total_recv 0 # HELP xmpp_service_total_sent stats about xmpp_service. # TYPE xmpp_service_total_sent counter -jitsi_xmpp_service_total_sent 2000 +jitsi_xmpp_service_total_sent 0 # HELP total jibris registered. # TYPE jibri_count gauge -jitsi_jibri_count 1 +jitsi_jibri_count 3 # HELP total jibri available stats. # TYPE jibri_available gauge -jitsi_jibri_available 1 +jitsi_jibri_available 3 # HELP jicofo largest_conferences stats. # TYPE largest_conference_jicofo_stats gauge -jitsi_jicofo_largest_conferences 2 +jitsi_jicofo_largest_conferences 0 # HELP jitsi_conference_sizes Distribution of conference sizes on jicofo # TYPE jitsi_conference_sizes gauge -jitsi_conference_sizes{conference_size="0"} 0 -jitsi_conference_sizes{conference_size="1"} 0 -jitsi_conference_sizes{conference_size="2"} 1 -jitsi_conference_sizes{conference_size="3"} 0 -jitsi_conference_sizes{conference_size="4"} 0 -jitsi_conference_sizes{conference_size="5"} 0 -jitsi_conference_sizes{conference_size="6"} 0 -jitsi_conference_sizes{conference_size="7"} 0 -jitsi_conference_sizes{conference_size="8"} 0 -jitsi_conference_sizes{conference_size="9"} 0 -jitsi_conference_sizes{conference_size="10"} 0 -jitsi_conference_sizes{conference_size="11"} 0 -jitsi_conference_sizes{conference_size="12"} 0 -jitsi_conference_sizes{conference_size="13"} 0 -jitsi_conference_sizes{conference_size="14"} 0 -jitsi_conference_sizes{conference_size="15"} 0 -jitsi_conference_sizes{conference_size="16"} 0 -jitsi_conference_sizes{conference_size="17"} 0 -jitsi_conference_sizes{conference_size="18"} 0 -jitsi_conference_sizes{conference_size="19"} 0 -jitsi_conference_sizes{conference_size="20"} 0 -jitsi_conference_sizes{conference_size="21"} 0 +jitsi_conference_sizes_total_values 0 +jitsi_conference_sizes_total_count 0 +jitsi_conference_sizes_average 0 +jitsi_conference_sizes_max 0 +jitsi_conference_sizes_min 0 +jitsi_conference_sizes_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 2 +jitsi_total_conferences_created 3 # HELP jitsi_threads_on_jicofo Threads count on jicofo # TYPE jitsi_jicofo_thread gauge -jitsi_jicofo_threads 224 +jitsi_jicofo_threads 30 # HELP jitsi_birdge_failure_participants_moved Participants moved after bridge failure # TYPE jitsi_bridge_failure_participants_moved gauge jitsi_bridge_failure_participants_moved 0 @@ -350,10 +302,10 @@ jitsi_bridge_failure_participants_moved 0 jitsi_bridge_failure_bridge_removed 0 # HELP jitsi_avg_allocate_channels_req_time_nanos Avg allocate channel request time. # TYPE jitsi_avg_allocate_channels_req_time_nanos gauge -jitsi_avg_allocate_channels_req_time_nanos 960278016 +jitsi_avg_allocate_channels_req_time_nanos 0 # HELP jitsi_total_participants Total number of participants joined so far. # TYPE jitsi_total_participants counter -jitsi_total_participants 3 +jitsi_total_participants 15 # HELP jitsi_participants_notification_ice_failed Stats about ice failure. # TYPE jitsi_participants_notification_ice_failed counter jitsi_participants_notification_ice_failed 0 @@ -365,13 +317,13 @@ jitsi_participants_notification_request_restart 0 jitsi_bridge_selector_total_least_loaded_in_region 0 # HELP jitsi_bridge_selector_total_split_due_to_load Bridges splitted due to load. # TYPE jitsi_bridge_selector_total_split_due_to_load gauge -jitsi_bridge_selector_total_split_due_to_load 0 +jitsi_bridge_selector_total_split_due_to_load 5 # HELP jitsi_bridge_selector_lost_bridges bridges lost because of some reasons # TYPE jitsi_bridge_selector_lost_bridges gauge -jitsi_bridge_selector_lost_bridges 0 +jitsi_bridge_selector_lost_bridges 6 # HELP jitsi_total_not_loaded_in_region_in_conference Bridges not loaded in a region in a conference. # TYPE jitsi_bridge_selector_total_not_loaded_in_region_in_conference gauge -jitsi_bridge_selector_total_not_loaded_in_region_in_conference 0 +jitsi_bridge_selector_total_not_loaded_in_region_in_conference 7 # HELP jitsi_in_shutdown_bridge_count Bridges count that are in shutdown. # TYPE jitsi_bridge_selector_in_shutdown_bridge_count gauge jitsi_bridge_selector_in_shutdown_bridge_count 0 @@ -380,22 +332,22 @@ jitsi_bridge_selector_in_shutdown_bridge_count 0 jitsi_bridge_selector_total_least_loaded_in_region_in_conference 0 # HELP jitsi_total_not_loaded_in_region Bridges that are not loaded in a region. # TYPE jitsi_bridge_selector_total_not_loaded_in_region gauge -jitsi_bridge_selector_total_not_loaded_in_region 0 +jitsi_bridge_selector_total_not_loaded_in_region 5 # HELP jitsi_total_split_due_to_region Bridges splitted due to region. # TYPE jitsi_bridge_selector_total_not_loaded_in_region gauge jitsi_bridge_selector_total_split_due_to_region 0 # HELP jitsi_bridge_count Number of bridges registered. # TYPE jitsi_bridge_count gauge -jitsi_bridge_count 1 +jitsi_bridge_count 3 # HELP jitsi_operational_bridge_count Bridges that are operational. # TYPE jitsi_operational_bridge_count gauge -jitsi_operational_bridge_count 1 +jitsi_operational_bridge_count 3 # HELP jitsi_total_least_loaded_in_conference Bridges that are least loaded in a conference. # TYPE jitsi_total_least_loaded_in_conference gauge jitsi_total_least_loaded_in_conference 0 # HELP jitsi_total_least_loaded Bridges that are least loaded. # TYPE jitsi_total_least_loaded gauge -jitsi_total_least_loaded 1 +jitsi_total_least_loaded 3 # HELP jitsi_total_sip_call_failures Total Sip call failures. # TYPE jitsi_total_least_loaded counter jitsi_total_sip_call_failures 0 @@ -425,58 +377,42 @@ jitsi_total_live_streaming_failures 0 jitsi_recording_active 0 # HELP jitsi_conferences Current running conferences. # TYPE jitsi_conferences gauge -jitsi_conferences 1 +jitsi_conferences 0 # HELP jitsi_participants Current participants. # TYPE jitsi_participants gauge jitsi_participants 2`, }, { // 2 participants - statsJson: `{"xmpp_service":{"total_recv":2000,"total_sent":2000},"jibri_detector":{"count":1,"available":1},"largest_conference":2,"conference_sizes":[0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"total_conferences_created":2,"threads":224,"xmpp":{},"jingle":{"received":{"transport-info":3,"session-accept":2},"sent":{"source-add":2,"session-initiate":2}},"bridge_failures":{"participants_moved":0,"bridges_removed":0},"avg_allocate_channels_req_time_nanos":1.9697896e+07,"total_participants":3,"participant_notifications":{"ice_failed":0,"request_restart":0},"bridge_selector":{"total_least_loaded_in_region":0,"total_split_due_to_load":0,"lost_bridges":1,"total_not_loaded_in_region_in_conference":0,"in_shutdown_bridge_count":0,"total_least_loaded_in_region_in_conference":0,"total_not_loaded_in_region":0,"total_split_due_to_region":0,"bridge_count":1,"operational_bridge_count":1,"total_least_loaded_in_conference":0,"total_least_loaded":1},"jibri":{"total_sip_call_failures":0,"live_streaming_pending":0,"recording_pending":0,"live_streaming_active":0,"total_recording_failures":0,"sip_call_pending":0,"sip_call_active":0,"total_live_streaming_failures":0,"recording_active":0},"conferences":1,"participants":2,"slow_health_check":2}`, + statsJson: `{"jibri_detector":{"count":3,"available":3},"largest_conference":0,"conference_sizes":{"average":null,"max":0,"min":0,"total_value":0,"total_count":0,"discarded":0,"buckets":{"0_to_1":0,"1_to_2":0,"2_to_3":0,"3_to_5":0,"5_to_10":0,"10_to_20":0,"20_to_50":0,"50_to_100":0,"100_to_200":0,"200_to_300":0,"300_to_400":0,"400_to_500":0,"500_to_max":0,"p99_upper_bound":-1,"p999_upper_bound":-1}},"total_conferences_created":3,"threads":30,"jingle":{"received":{"transport-info":15,"session-accept":15},"sent":{"session-initiate":15,"session-terminate":1,"source-add":28}},"bridge_failures":{"participants_moved":0},"total_participants":15,"participant_notifications":{"ice_failed":0,"request_restart":0},"queues":{"jibri-iq-queue":{"added_packets":4,"removed_packets":4,"dropped_packets":0,"duration_s":64686.453447,"average_remove_rate_pps":6.183674922412229E-5,"queue_size_at_remove":{"average_queue_size_at_remove":0.0,"max_queue_size_at_remove":0,"min_queue_size_at_remove":0,"total_value":0,"total_count":4,"discarded":0,"buckets":{"0_to_1":4,"1_to_4":0,"4_to_16":0,"16_to_64":0,"64_to_256":0,"256_to_1024":0,"1024_to_4096":0,"4096_to_16384":0,"16384_to_max":0,"p99_upper_bound":-1,"p999_upper_bound":-1}}}},"jigasi":{},"healthy":true,"bridge_selector":{"total_least_loaded_in_region_group":0,"lost_bridges":6,"total_not_loaded_in_region_in_conference":7,"in_shutdown_bridge_count":0,"total_not_loaded_in_region_group":0,"operational_bridge_count":3,"total_not_loaded_in_region_group_in_conference":0,"total_least_loaded_in_region_group_in_conference":0,"total_least_loaded":3,"total_least_loaded_in_region":0,"total_split_due_to_load":5,"total_least_loaded_in_region_in_conference":0,"total_not_loaded_in_region":5,"total_split_due_to_region":0,"bridge_count":3,"total_least_loaded_in_conference":0},"jibri":{"total_sip_call_failures":0,"live_streaming_pending":0,"recording_pending":0,"live_streaming_active":0,"total_recording_failures":0,"sip_call_pending":0,"sip_call_active":0,"total_live_streaming_failures":0,"recording_active":0},"endpoint_pairs":0,"conferences":0,"participants":2,"slow_health_check":0}`, expected: `# HELP xmpp_service_total_recv stats about xmpp_service. # TYPE xmpp_service_total_recv counter -jitsi_xmpp_service_total_recv 2000 +jitsi_xmpp_service_total_recv 0 # HELP xmpp_service_total_sent stats about xmpp_service. # TYPE xmpp_service_total_sent counter -jitsi_xmpp_service_total_sent 2000 +jitsi_xmpp_service_total_sent 0 # HELP total jibris registered. # TYPE jibri_count gauge -jitsi_jibri_count 1 +jitsi_jibri_count 3 # HELP total jibri available stats. # TYPE jibri_available gauge -jitsi_jibri_available 1 +jitsi_jibri_available 3 # HELP jicofo largest_conferences stats. # TYPE largest_conference_jicofo_stats gauge -jitsi_jicofo_largest_conferences 2 +jitsi_jicofo_largest_conferences 0 # HELP jitsi_conference_sizes Distribution of conference sizes on jicofo # TYPE jitsi_conference_sizes gauge -jitsi_conference_sizes{conference_size="0"} 0 -jitsi_conference_sizes{conference_size="1"} 0 -jitsi_conference_sizes{conference_size="2"} 1 -jitsi_conference_sizes{conference_size="3"} 0 -jitsi_conference_sizes{conference_size="4"} 0 -jitsi_conference_sizes{conference_size="5"} 0 -jitsi_conference_sizes{conference_size="6"} 0 -jitsi_conference_sizes{conference_size="7"} 0 -jitsi_conference_sizes{conference_size="8"} 0 -jitsi_conference_sizes{conference_size="9"} 0 -jitsi_conference_sizes{conference_size="10"} 0 -jitsi_conference_sizes{conference_size="11"} 0 -jitsi_conference_sizes{conference_size="12"} 0 -jitsi_conference_sizes{conference_size="13"} 0 -jitsi_conference_sizes{conference_size="14"} 0 -jitsi_conference_sizes{conference_size="15"} 0 -jitsi_conference_sizes{conference_size="16"} 0 -jitsi_conference_sizes{conference_size="17"} 0 -jitsi_conference_sizes{conference_size="18"} 0 -jitsi_conference_sizes{conference_size="19"} 0 -jitsi_conference_sizes{conference_size="20"} 0 -jitsi_conference_sizes{conference_size="21"} 0 +jitsi_conference_sizes_total_values 0 +jitsi_conference_sizes_total_count 0 +jitsi_conference_sizes_average 0 +jitsi_conference_sizes_max 0 +jitsi_conference_sizes_min 0 +jitsi_conference_sizes_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 2 +jitsi_total_conferences_created 3 # HELP jitsi_threads_on_jicofo Threads count on jicofo # TYPE jitsi_jicofo_thread gauge -jitsi_jicofo_threads 224 +jitsi_jicofo_threads 30 # HELP jitsi_birdge_failure_participants_moved Participants moved after bridge failure # TYPE jitsi_bridge_failure_participants_moved gauge jitsi_bridge_failure_participants_moved 0 @@ -485,10 +421,10 @@ jitsi_bridge_failure_participants_moved 0 jitsi_bridge_failure_bridge_removed 0 # HELP jitsi_avg_allocate_channels_req_time_nanos Avg allocate channel request time. # TYPE jitsi_avg_allocate_channels_req_time_nanos gauge -jitsi_avg_allocate_channels_req_time_nanos 19697896 +jitsi_avg_allocate_channels_req_time_nanos 0 # HELP jitsi_total_participants Total number of participants joined so far. # TYPE jitsi_total_participants counter -jitsi_total_participants 3 +jitsi_total_participants 15 # HELP jitsi_participants_notification_ice_failed Stats about ice failure. # TYPE jitsi_participants_notification_ice_failed counter jitsi_participants_notification_ice_failed 0 @@ -500,13 +436,13 @@ jitsi_participants_notification_request_restart 0 jitsi_bridge_selector_total_least_loaded_in_region 0 # HELP jitsi_bridge_selector_total_split_due_to_load Bridges splitted due to load. # TYPE jitsi_bridge_selector_total_split_due_to_load gauge -jitsi_bridge_selector_total_split_due_to_load 0 +jitsi_bridge_selector_total_split_due_to_load 5 # HELP jitsi_bridge_selector_lost_bridges bridges lost because of some reasons # TYPE jitsi_bridge_selector_lost_bridges gauge -jitsi_bridge_selector_lost_bridges 1 +jitsi_bridge_selector_lost_bridges 6 # HELP jitsi_total_not_loaded_in_region_in_conference Bridges not loaded in a region in a conference. # TYPE jitsi_bridge_selector_total_not_loaded_in_region_in_conference gauge -jitsi_bridge_selector_total_not_loaded_in_region_in_conference 0 +jitsi_bridge_selector_total_not_loaded_in_region_in_conference 7 # HELP jitsi_in_shutdown_bridge_count Bridges count that are in shutdown. # TYPE jitsi_bridge_selector_in_shutdown_bridge_count gauge jitsi_bridge_selector_in_shutdown_bridge_count 0 @@ -515,22 +451,22 @@ jitsi_bridge_selector_in_shutdown_bridge_count 0 jitsi_bridge_selector_total_least_loaded_in_region_in_conference 0 # HELP jitsi_total_not_loaded_in_region Bridges that are not loaded in a region. # TYPE jitsi_bridge_selector_total_not_loaded_in_region gauge -jitsi_bridge_selector_total_not_loaded_in_region 0 +jitsi_bridge_selector_total_not_loaded_in_region 5 # HELP jitsi_total_split_due_to_region Bridges splitted due to region. # TYPE jitsi_bridge_selector_total_not_loaded_in_region gauge jitsi_bridge_selector_total_split_due_to_region 0 # HELP jitsi_bridge_count Number of bridges registered. # TYPE jitsi_bridge_count gauge -jitsi_bridge_count 1 +jitsi_bridge_count 3 # HELP jitsi_operational_bridge_count Bridges that are operational. # TYPE jitsi_operational_bridge_count gauge -jitsi_operational_bridge_count 1 +jitsi_operational_bridge_count 3 # HELP jitsi_total_least_loaded_in_conference Bridges that are least loaded in a conference. # TYPE jitsi_total_least_loaded_in_conference gauge jitsi_total_least_loaded_in_conference 0 # HELP jitsi_total_least_loaded Bridges that are least loaded. # TYPE jitsi_total_least_loaded gauge -jitsi_total_least_loaded 1 +jitsi_total_least_loaded 3 # HELP jitsi_total_sip_call_failures Total Sip call failures. # TYPE jitsi_total_least_loaded counter jitsi_total_sip_call_failures 0 @@ -560,7 +496,7 @@ jitsi_total_live_streaming_failures 0 jitsi_recording_active 0 # HELP jitsi_conferences Current running conferences. # TYPE jitsi_conferences gauge -jitsi_conferences 1 +jitsi_conferences 0 # HELP jitsi_participants Current participants. # TYPE jitsi_participants gauge jitsi_participants 2`,