From 3441c77234a1f2d1df67316d899f5f0d02c0ffd5 Mon Sep 17 00:00:00 2001 From: Takeshi NAMAO Date: Thu, 4 Jan 2024 15:17:56 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=AF=E3=83=A9=E3=82=B9=E3=82=BF=E3=83=BC?= =?UTF-8?q?=E3=83=A1=E3=83=88=E3=83=AA=E3=82=AF=E3=82=B9=E3=81=AE=E6=9C=9F?= =?UTF-8?q?=E5=BE=85=E5=80=A4=E3=82=92=E5=A4=89=E6=9B=B4=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main_test.go | 55 +++++++++++++---------- test/maximum.metrics | 3 +- test/sora_cluster_metrics_enabled.metrics | 3 +- 3 files changed, 36 insertions(+), 25 deletions(-) diff --git a/main_test.go b/main_test.go index 276625a..1516b87 100644 --- a/main_test.go +++ b/main_test.go @@ -150,17 +150,7 @@ var ( listClusterNodesJSONData = `[ { "node_name": "node-01_canary_sora@10.211.55.42", - "epoch": 1, - "mode": "normal", - "cluster_signaling_url": "ws://127.0.0.1:5001/signaling", - "cluster_api_url": "http://127.0.0.1:3101/", - "member_since": "2022-05-09T07:44:52.973761Z", - "sora_version": "2022.1.0-canary.44", - "license_max_nodes": 10, - "license_max_connections": 100, - "license_serial_code": "SAMPLE-SRA-E001-202212-N10-100", - "license_type": "Experimental", - "connected": true + "connected": false }, { "node_name": "node-02_canary_sora@10.211.55.40", @@ -175,20 +165,25 @@ var ( "license_serial_code": "SAMPLE-SRA-E001-202212-N10-100", "license_type": "Experimental", "connected": true - } - ]` + }, + { + "node_name": "node-03_canary_sora@10.211.55.41", + "epoch": 1, + "mode": "normal", + "cluster_signaling_url": "ws://127.0.0.1:5001/signaling", + "cluster_api_url": "http://127.0.0.1:3101/", + "member_since": "2022-05-09T07:44:54.160763Z", + "sora_version": "2022.1.0-canary.44", + "license_max_nodes": 10, + "license_max_connections": 100, + "license_serial_code": "SAMPLE-SRA-E001-202212-N10-100", + "license_type": "Experimental", + "connected": true + } + ]` listClusterNodesCurrentJSONData = `[ { "cluster_node_name": "node-01_canary_sora@10.211.55.42", - "epoch": 1, - "mode": "normal", - "member_since": "2022-05-02T15:26:44.302363Z", - "sora_version": "2021.2.9", - "license_max_connections": 100, - "license_serial_code": "SAMPLE-SRA-E001-202212-N10-100", - "license_type": "Experimental", - "cluster_signaling_url": "ws://127.0.0.1:5001/signaling", - "cluster_api_url": "http://10.1.1.4:3000/", "connected": false }, { @@ -203,7 +198,21 @@ var ( "cluster_signaling_url": "ws://127.0.0.1:5002/signaling", "cluster_api_url": "http://10.1.1.3:3000/", "connected": true - } + }, + { + "node_name": "node-03_canary_sora@10.211.55.41", + "epoch": 1, + "mode": "normal", + "cluster_signaling_url": "ws://127.0.0.1:5001/signaling", + "cluster_api_url": "http://127.0.0.1:3101/", + "member_since": "2022-05-09T07:44:54.160763Z", + "sora_version": "2022.1.0-canary.44", + "license_max_nodes": 10, + "license_max_connections": 100, + "license_serial_code": "SAMPLE-SRA-E001-202212-N10-100", + "license_type": "Experimental", + "connected": true + } ]` getLicenseJSONDATA = `{ "expired_at": "2025-09", diff --git a/test/maximum.metrics b/test/maximum.metrics index 755e312..fc7d4fa 100644 --- a/test/maximum.metrics +++ b/test/maximum.metrics @@ -10,8 +10,9 @@ sora_average_duration_seconds 706 sora_average_setup_time_seconds 0 # HELP sora_cluster_node The sora server known cluster node. # TYPE sora_cluster_node gauge +sora_cluster_node{mode="",node_name="node-01_canary_sora@10.211.55.42"} 0 sora_cluster_node{mode="block_new_connection",node_name="node-02_canary_sora@10.211.55.40"} 1 -sora_cluster_node{mode="normal",node_name="node-01_canary_sora@10.211.55.42"} 1 +sora_cluster_node{mode="normal",node_name="node-03_canary_sora@10.211.55.41"} 1 # HELP sora_cluster_raft_commit_index The latest committed Raft log index. # TYPE sora_cluster_raft_commit_index counter sora_cluster_raft_commit_index 10 diff --git a/test/sora_cluster_metrics_enabled.metrics b/test/sora_cluster_metrics_enabled.metrics index 150c02e..757e071 100644 --- a/test/sora_cluster_metrics_enabled.metrics +++ b/test/sora_cluster_metrics_enabled.metrics @@ -10,8 +10,9 @@ sora_average_duration_seconds 706 sora_average_setup_time_seconds 0 # HELP sora_cluster_node The sora server known cluster node. # TYPE sora_cluster_node gauge +sora_cluster_node{mode="normal",node_name="node-03_canary_sora@10.211.55.41"} 1 sora_cluster_node{mode="block_new_connection",node_name="node-02_canary_sora@10.211.55.40"} 1 -sora_cluster_node{mode="normal",node_name="node-01_canary_sora@10.211.55.42"} 1 +sora_cluster_node{mode="",node_name="node-01_canary_sora@10.211.55.42"} 0 # HELP sora_cluster_raft_commit_index The latest committed Raft log index. # TYPE sora_cluster_raft_commit_index counter sora_cluster_raft_commit_index 10