Skip to content

Commit

Permalink
テストコードにクラスターリレーのメトリクスのテストを追加する
Browse files Browse the repository at this point in the history
  • Loading branch information
tnamao committed Mar 29, 2024
1 parent 390864d commit 3e80597
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
16 changes: 16 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@ var (
"raft_state": "follower",
"raft_term": 3
},
"cluster_relay": [
{
"node_name": "node-01",
"total_received_byte_size": 11,
"total_sent_byte_size": 12,
"total_received": 13,
"total_sent": 14
},
{
"node_name": "node-02",
"total_received_byte_size": 21,
"total_sent_byte_size": 22,
"total_received": 23,
"total_sent": 24
}
],
"erlang_vm": {
"memory": {
"total": 1234,
Expand Down
16 changes: 16 additions & 0 deletions test/maximum.metrics
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@ sora_cluster_raft_state{state="follower"} 1
# HELP sora_cluster_raft_term The current Raft term.
# TYPE sora_cluster_raft_term counter
sora_cluster_raft_term 3
# HELP sora_cluster_relay_received_bytes The total number of bytes received by the cluster relay.
# TYPE sora_cluster_relay_received_bytes counter
sora_cluster_relay_received_bytes{node_name="node-01"} 11
sora_cluster_relay_received_bytes{node_name="node-02"} 21
# HELP sora_cluster_relay_received_packets The total number of packets received by the cluster relay.
# TYPE sora_cluster_relay_received_packets counter
sora_cluster_relay_received_packets{node_name="node-01"} 13
sora_cluster_relay_received_packets{node_name="node-02"} 23
# HELP sora_cluster_relay_sent_bytes The total number of bytes sent by the cluster relay.
# TYPE sora_cluster_relay_sent_bytes counter
sora_cluster_relay_sent_bytes{node_name="node-01"} 12
sora_cluster_relay_sent_bytes{node_name="node-02"} 22
# HELP sora_cluster_relay_sent_packets The total number of packets sent by the cluster relay.
# TYPE sora_cluster_relay_sent_packets counter
sora_cluster_relay_sent_packets{node_name="node-01"} 14
sora_cluster_relay_sent_packets{node_name="node-02"} 24
# HELP sora_client_type_total The total number of connections by Sora client types
# TYPE sora_client_type_total counter
sora_client_type_total{client="android_sdk",state="failed"} 1
Expand Down
16 changes: 16 additions & 0 deletions test/sora_cluster_metrics_enabled.metrics
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@ sora_cluster_raft_state{state="follower"} 1
# HELP sora_cluster_raft_term The current Raft term.
# TYPE sora_cluster_raft_term counter
sora_cluster_raft_term 3
# HELP sora_cluster_relay_received_bytes The total number of bytes received by the cluster relay.
# TYPE sora_cluster_relay_received_bytes counter
sora_cluster_relay_received_bytes{node_name="node-01"} 11
sora_cluster_relay_received_bytes{node_name="node-02"} 21
# HELP sora_cluster_relay_received_packets The total number of packets received by the cluster relay.
# TYPE sora_cluster_relay_received_packets counter
sora_cluster_relay_received_packets{node_name="node-01"} 13
sora_cluster_relay_received_packets{node_name="node-02"} 23
# HELP sora_cluster_relay_sent_bytes The total number of bytes sent by the cluster relay.
# TYPE sora_cluster_relay_sent_bytes counter
sora_cluster_relay_sent_bytes{node_name="node-01"} 12
sora_cluster_relay_sent_bytes{node_name="node-02"} 22
# HELP sora_cluster_relay_sent_packets The total number of packets sent by the cluster relay.
# TYPE sora_cluster_relay_sent_packets counter
sora_cluster_relay_sent_packets{node_name="node-01"} 14
sora_cluster_relay_sent_packets{node_name="node-02"} 24
# HELP sora_connections_total The total number of connections created.
# TYPE sora_connections_total counter
sora_connections_total{state="created"} 2
Expand Down

0 comments on commit 3e80597

Please sign in to comment.