Skip to content

Commit

Permalink
Merge pull request #151 from Movion/add-video-endpoints
Browse files Browse the repository at this point in the history
Add endpoints_sending_video metric to main and test
  • Loading branch information
0x46616c6b authored May 24, 2024
2 parents 519d570 + 6de011f commit a87feb8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type videoBridgeStats struct {
P2PConferences int `json:"p2p_conferences"`
Participants int `json:"participants"`
Videostreams int `json:"videostreams"`
EndpointsSendingVideo int `json:"endpoints_sending_video"`
StressLevel float64 `json:"stress_level"`
TotalLossControlledParticipantSeconds int `json:"total_loss_controlled_participant_seconds"`
TotalLossLimitedParticipantSeconds int `json:"total_loss_limited_participant_seconds"`
Expand Down Expand Up @@ -111,6 +112,9 @@ jitsi_participants {{.Participants}}
# HELP jitsi_total_participants Total participants since running.
# TYPE jitsi_total_participants gauge
jitsi_total_participants {{.TotalParticipants}}
# HELP jitsi_endpoint_sending_video An estimation of the number of current endpoints sending a video stream.
# TYPE jitsi_endpoint_sending_video gauge
jitsi_endpoints_sending_video {{.EndpointsSendingVideo}}
# HELP jitsi_videostreams An estimation of the number of current video streams forwarded by the bridge.
# TYPE jitsi_videostreams gauge
jitsi_videostreams {{.Videostreams}}
Expand Down Expand Up @@ -246,4 +250,4 @@ func main() {
}

log.Println("Started Jitsi Meet Metrics Exporter")
}
}
13 changes: 10 additions & 3 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestGetMetrics(t *testing.T) {
expected string
}{
{
statsJson: `{"largest_conference":3,"total_sip_call_failures":0,"total_participants":18,"conference_sizes":[0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"bridge_selector":{"total_least_loaded_in_region":0,"total_split_due_to_load":0,"total_not_loaded_in_region_in_conference":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":3},"total_conferences_created":14,"total_conferences_completed":0,"total_recording_failures":0,"conferences":2,"p2p_conferences":1,"total_live_streaming_failures":0,"participants":4}`,
statsJson: `{"largest_conference":3,"total_sip_call_failures":0,"total_participants":18,"conference_sizes":[0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"bridge_selector":{"total_least_loaded_in_region":0,"total_split_due_to_load":0,"total_not_loaded_in_region_in_conference":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":3},"total_conferences_created":14,"total_conferences_completed":0,"total_recording_failures":0,"conferences":2,"p2p_conferences":1,"total_live_streaming_failures":0,"endpoints_sending_video":10,"participants":4}`,
expected: `# HELP jitsi_threads The number of Java threads that the video bridge is using.
# TYPE jitsi_threads gauge
jitsi_threads 0
Expand Down Expand Up @@ -71,6 +71,9 @@ jitsi_participants 4
# HELP jitsi_total_participants Total participants since running.
# TYPE jitsi_total_participants gauge
jitsi_total_participants 18
# HELP jitsi_endpoint_sending_video An estimation of the number of current endpoints sending a video stream.
# TYPE jitsi_endpoint_sending_video gauge
jitsi_endpoints_sending_video 10
# HELP jitsi_videostreams An estimation of the number of current video streams forwarded by the bridge.
# TYPE jitsi_videostreams gauge
jitsi_videostreams 0
Expand Down Expand Up @@ -248,7 +251,8 @@ jitsi_conference_sizes{conference_size="21"} 0
"total_participants": 2,
"total_ice_succeeded_relayed": 3,
"videochannels": 0,
"videostreams": 0
"videostreams": 0,
"endpoints_sending_video": 10
}`,
expected: `# HELP jitsi_threads The number of Java threads that the video bridge is using.
# TYPE jitsi_threads gauge
Expand Down Expand Up @@ -298,6 +302,9 @@ jitsi_participants 0
# HELP jitsi_total_participants Total participants since running.
# TYPE jitsi_total_participants gauge
jitsi_total_participants 2
# HELP jitsi_endpoint_sending_video An estimation of the number of current endpoints sending a video stream.
# TYPE jitsi_endpoint_sending_video gauge
jitsi_endpoints_sending_video 10
# HELP jitsi_videostreams An estimation of the number of current video streams forwarded by the bridge.
# TYPE jitsi_videostreams gauge
jitsi_videostreams 0
Expand Down Expand Up @@ -440,4 +447,4 @@ jitsi_conference_sizes{conference_size="21"} 0

srv.Close()
}
}
}

0 comments on commit a87feb8

Please sign in to comment.