Skip to content

Commit

Permalink
Merge pull request #40 from shiguredo/feature/add-obs-whep-client
Browse files Browse the repository at this point in the history
obs_studio_whep へ対応する
  • Loading branch information
tnamao authored Mar 29, 2024
2 parents 92137b1 + 6114f0a commit 280646a
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# CHANGES

- [ADD] `sora_client``obs_studio_whep` に対応する
- @tnamao
- [ADD] Sora のクラスターリレー機能のメトリクスを追加する
- GetStatsReport API の `cluster_relay` 以下の統計情報を、起動オプションの `--sora.cluster-metrics` を有効にした時のみ収集する
- 次のメトリクスを送受信しているノード単位で返す
Expand Down
2 changes: 2 additions & 0 deletions collector/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func (m *ClientMetrics) Collect(ch chan<- prometheus.Metric, report soraClientRe
ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalFailedSoraClientType.SoraJsSdk), "js_sdk", "failed")
ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalFailedSoraClientType.SoraUnitySdk), "unity_sdk", "failed")
ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalFailedSoraClientType.ObsStudioWhip), "obs_studio_whip", "failed")
ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalFailedSoraClientType.ObsStudioWhep), "obs_studio_whep", "failed")
ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalFailedSoraClientType.SoraPythonSdk), "python_sdk", "failed")
ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalFailedSoraClientType.Unknown), "unknown", "failed")
ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalFailedSoraClientType.WebrtcLoadTestingToolZakuro), "zakuro", "failed")
Expand All @@ -38,6 +39,7 @@ func (m *ClientMetrics) Collect(ch chan<- prometheus.Metric, report soraClientRe
ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalSuccessfulSoraClientType.SoraJsSdk), "js_sdk", "successful")
ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalSuccessfulSoraClientType.SoraUnitySdk), "unity_sdk", "successful")
ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalSuccessfulSoraClientType.ObsStudioWhip), "obs_studio_whip", "successful")
ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalSuccessfulSoraClientType.ObsStudioWhep), "obs_studio_whep", "successful")
ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalSuccessfulSoraClientType.SoraPythonSdk), "python_sdk", "successful")
ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalSuccessfulSoraClientType.Unknown), "unknown", "successful")
ch <- newCounter(m.totalSoraClientConnections, float64(report.TotalSuccessfulSoraClientType.WebrtcLoadTestingToolZakuro), "zakuro", "successful")
Expand Down
1 change: 1 addition & 0 deletions collector/sora_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ type soraClientStatistics struct {
SoraJsSdk int64 `json:"sora_js_sdk"`
SoraUnitySdk int64 `json:"sora_unity_sdk"`
ObsStudioWhip int64 `json:"obs_studio_whip"`
ObsStudioWhep int64 `json:"obs_studio_whep"`
SoraPythonSdk int64 `json:"sora_python_sdk"`
Unknown int64 `json:"unknown"`
WebrtcLoadTestingToolZakuro int64 `json:"webrtc_load_testing_tool_zakuro"`
Expand Down
2 changes: 2 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ var (
"sora_js_sdk": 3,
"sora_unity_sdk": 4,
"obs_studio_whip": 10,
"obs_studio_whep": 13,
"sora_python_sdk": 11,
"unknown": 5,
"webrtc_load_testing_tool_zakuro": 8,
Expand All @@ -135,6 +136,7 @@ var (
"sora_js_sdk": 33,
"sora_unity_sdk": 44,
"obs_studio_whip": 1010,
"obs_studio_whep": 1313,
"sora_python_sdk": 1111,
"unknown": 55,
"webrtc_load_testing_tool_zakuro": 88,
Expand Down
2 changes: 2 additions & 0 deletions test/maximum.metrics
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ sora_client_type_total{client="momo",state="failed"} 6
sora_client_type_total{client="momo",state="successful"} 66
sora_client_type_total{client="unity_sdk",state="failed"} 4
sora_client_type_total{client="unity_sdk",state="successful"} 44
sora_client_type_total{client="obs_studio_whep",state="failed"} 13
sora_client_type_total{client="obs_studio_whep",state="successful"} 1313
sora_client_type_total{client="obs_studio_whip",state="failed"} 10
sora_client_type_total{client="obs_studio_whip",state="successful"} 1010
sora_client_type_total{client="python_sdk",state="failed"} 11
Expand Down
2 changes: 2 additions & 0 deletions test/sora_client_enabled.metrics
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ sora_client_type_total{client="momo",state="failed"} 6
sora_client_type_total{client="momo",state="successful"} 66
sora_client_type_total{client="unity_sdk",state="failed"} 4
sora_client_type_total{client="unity_sdk",state="successful"} 44
sora_client_type_total{client="obs_studio_whep",state="failed"} 13
sora_client_type_total{client="obs_studio_whep",state="successful"} 1313
sora_client_type_total{client="obs_studio_whip",state="failed"} 10
sora_client_type_total{client="obs_studio_whip",state="successful"} 1010
sora_client_type_total{client="python_sdk",state="failed"} 11
Expand Down

0 comments on commit 280646a

Please sign in to comment.