統計 API¶
注意
この API は 実験的機能 のため、正式版では仕様が変更される可能性があります。
GetStatsReport¶
- x-sora-target:
Sora_20171010.GetStatsReport
Sora が起動している間の Sora 全体の統計情報を取得できます。この統計情報は Sora を止めたり再起動したりすることでクリアされますので注意してください。
レスポンス項目¶
version
sora のバージョン
total_connection_created
現在までの接続が作成された数
total_connection_updated
現在までの接続が更新された数
total_connection_destroyed
現在までの接続が破棄された数
total_session_created
現在までのセッションが作成された数
total_session_destroyed
現在までのセッションが破棄された数
total_successful_connections
現在までの接続が成功した数
total_ongoing_connections
現在接続している数
total_failed_connections
現在までの接続が失敗した数
total_duration_sec
現在までの合計接続時間 (秒)
total_turn_udp_connections
現在までの TURN-UDP での接続数
total_turn_tcp_connections
現在までの TURN-TCP または TURN-TLS での接続数
total_received_invalid_turn_tcp_packet
現在までの TURN-TCP でパースできないパケットが送られてきた数
total_auth_webhook_allowed
認証ウェブフックで許可された数
total_auth_webhook_denied
認証ウェブフックで拒否された数
total_successful_auth_webhook
認証ウェブフックが成功した数
total_failed_auth_webhook
認証ウェブフックが失敗した数
total_successful_session_webhook
セッションウェブフックが成功した数
total_failed_session_webhook
セッションウェブフックが失敗した数
total_successful_event_webhook
イベントウェブフックが成功した数
total_failed_event_webhook
イベントウェブフックが失敗した数
average_duration_sec
平均接続時間 (秒)
average_setup_time_msec
平均セットアップ時間 (ミリ秒)
セットアップ時間とはシグナリング接続開始から WebRTC が確立するまでにかかった時間です
cluster
現時点ではクラスター機能で採用している Raft Consensus Algorithm の情報です
raft_commit_index
Raft ノードが最後にコミットしたログのインデックス番号
raft_state
Raft ノードの現在の状態
raft_term
Raft ノードの現在の term
ウェブフックの成功は 2xx 系が戻ってきておりかつ、JSON がある場合は JSON のパースに失敗しない場合です。 それ以外は失敗としています。
$ http POST 127.0.0.1:3000/ \
x-sora-target:Sora_20171010.GetStatsReport \
-vvv
POST / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 0
Host: 127.0.0.1:3000
User-Agent: HTTPie/0.9.9
x-sora-target: Sora_20171010.GetStatsReport
HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 172
content-type: application/json
date: Tue, 10 Oct 2017 10:23:22 GMT
server: Cowboy
{
"average_duration_sec": 1450,
"average_setup_time_msec": 879,
"cluster": {
"raft_commit_index": 28,
"raft_state": "follower",
"raft_term": 1
},
"total_auth_webhook_allowed": 3,
"total_auth_webhook_denied": 0,
"total_connection_created": 3,
"total_connection_destroyed": 2,
"total_connection_updated": 48,
"total_duration_sec": 2901,
"total_failed_auth_webhook": 0,
"total_failed_connections": 0,
"total_failed_event_webhook": 0,
"total_failed_session_webhook": 0,
"total_ongoing_connections": 1,
"total_received_invalid_turn_tcp_packet": 38,
"total_session_created": 3,
"total_session_destroyed": 2,
"total_successful_auth_webhook": 3,
"total_successful_connections": 3,
"total_successful_event_webhook": 60,
"total_successful_session_webhook": 5,
"total_turn_tcp_connections": 0,
"total_turn_udp_connections": 3,
}