[#354] Fixed grpc test metrics
Signed-off-by: Ilyas Niyazov <i.niyazov@yadro.com>
This commit is contained in:
parent
b4d27260ef
commit
ee1f898849
1 changed files with 30 additions and 16 deletions
|
@ -31,6 +31,7 @@ class TestGRPCMetrics(ClusterTestBase):
|
||||||
|
|
||||||
@allure.title("GRPC metrics container operations")
|
@allure.title("GRPC metrics container operations")
|
||||||
def test_grpc_metrics_container_operations(self, default_wallet: WalletInfo, cluster: Cluster):
|
def test_grpc_metrics_container_operations(self, default_wallet: WalletInfo, cluster: Cluster):
|
||||||
|
operations_count = 10
|
||||||
placement_policy = "REP 2 IN X CBF 1 SELECT 4 FROM * AS X"
|
placement_policy = "REP 2 IN X CBF 1 SELECT 4 FROM * AS X"
|
||||||
|
|
||||||
with reporter.step("Select random node"):
|
with reporter.step("Select random node"):
|
||||||
|
@ -56,12 +57,14 @@ class TestGRPCMetrics(ClusterTestBase):
|
||||||
metrics_counter_get = get_metrics_value(node, command="grpc_server_handled_total", service="ContainerService", method="Get")
|
metrics_counter_get = get_metrics_value(node, command="grpc_server_handled_total", service="ContainerService", method="Get")
|
||||||
|
|
||||||
with reporter.step(f"Get container"):
|
with reporter.step(f"Get container"):
|
||||||
get_container(default_wallet, cid, self.shell, node.storage_node.get_rpc_endpoint())
|
for _ in range(operations_count):
|
||||||
|
get_container(default_wallet, cid, self.shell, node.storage_node.get_rpc_endpoint())
|
||||||
|
|
||||||
with reporter.step(f"Check gRPC metrics method=Get, 'the counter should increase by 1'"):
|
with reporter.step(f"Check gRPC metrics method=Get, 'the counter should increase by 1'"):
|
||||||
metrics_counter_get += 1
|
metrics_counter_get += operations_count
|
||||||
check_metrics_counter(
|
check_metrics_counter(
|
||||||
[node],
|
[node],
|
||||||
|
operator=">=",
|
||||||
counter_exp=metrics_counter_get,
|
counter_exp=metrics_counter_get,
|
||||||
command="grpc_server_handled_total",
|
command="grpc_server_handled_total",
|
||||||
service="ContainerService",
|
service="ContainerService",
|
||||||
|
@ -72,12 +75,14 @@ class TestGRPCMetrics(ClusterTestBase):
|
||||||
metrics_counter_list = get_metrics_value(node, command="grpc_server_handled_total", service="ContainerService", method="List")
|
metrics_counter_list = get_metrics_value(node, command="grpc_server_handled_total", service="ContainerService", method="List")
|
||||||
|
|
||||||
with reporter.step(f"Get container list"):
|
with reporter.step(f"Get container list"):
|
||||||
list_containers(default_wallet, self.shell, node.storage_node.get_rpc_endpoint())
|
for _ in range(operations_count):
|
||||||
|
list_containers(default_wallet, self.shell, node.storage_node.get_rpc_endpoint())
|
||||||
|
|
||||||
with reporter.step(f"Check gRPC metrics method=List, 'the counter should increase by 1'"):
|
with reporter.step(f"Check gRPC metrics method=List, 'the counter should increase by 1'"):
|
||||||
metrics_counter_list += 1
|
metrics_counter_list += operations_count
|
||||||
check_metrics_counter(
|
check_metrics_counter(
|
||||||
[node],
|
[node],
|
||||||
|
operator=">=",
|
||||||
counter_exp=metrics_counter_list,
|
counter_exp=metrics_counter_list,
|
||||||
command="grpc_server_handled_total",
|
command="grpc_server_handled_total",
|
||||||
service="ContainerService",
|
service="ContainerService",
|
||||||
|
@ -88,6 +93,7 @@ class TestGRPCMetrics(ClusterTestBase):
|
||||||
def test_grpc_metrics_object_operations(
|
def test_grpc_metrics_object_operations(
|
||||||
self, simple_object_size: ObjectSize, default_wallet: WalletInfo, cluster: Cluster, container: str, disable_policer
|
self, simple_object_size: ObjectSize, default_wallet: WalletInfo, cluster: Cluster, container: str, disable_policer
|
||||||
):
|
):
|
||||||
|
operations_count = 10
|
||||||
file_path = generate_file(simple_object_size.value)
|
file_path = generate_file(simple_object_size.value)
|
||||||
|
|
||||||
with reporter.step("Select random node"):
|
with reporter.step("Select random node"):
|
||||||
|
@ -97,12 +103,14 @@ class TestGRPCMetrics(ClusterTestBase):
|
||||||
metrics_counter_put = get_metrics_value(node, command="grpc_server_handled_total", service="ObjectService", method="Put")
|
metrics_counter_put = get_metrics_value(node, command="grpc_server_handled_total", service="ObjectService", method="Put")
|
||||||
|
|
||||||
with reporter.step("Put object to selected node"):
|
with reporter.step("Put object to selected node"):
|
||||||
oid = put_object(default_wallet, file_path, container, self.shell, node.storage_node.get_rpc_endpoint())
|
for _ in range(operations_count):
|
||||||
|
oid = put_object(default_wallet, file_path, container, self.shell, node.storage_node.get_rpc_endpoint())
|
||||||
|
|
||||||
with reporter.step(f"Check gRPC metrics method 'Put', 'the counter should increase by 1'"):
|
with reporter.step(f"Check gRPC metrics method 'Put', 'the counter should increase by {operations_count}'"):
|
||||||
metrics_counter_put += 1
|
metrics_counter_put += operations_count
|
||||||
check_metrics_counter(
|
check_metrics_counter(
|
||||||
[node],
|
[node],
|
||||||
|
operator=">=",
|
||||||
counter_exp=metrics_counter_put,
|
counter_exp=metrics_counter_put,
|
||||||
command="grpc_server_handled_total",
|
command="grpc_server_handled_total",
|
||||||
service="ObjectService",
|
service="ObjectService",
|
||||||
|
@ -113,12 +121,14 @@ class TestGRPCMetrics(ClusterTestBase):
|
||||||
metrics_counter_get = get_metrics_value(node, command="grpc_server_handled_total", service="ObjectService", method="Get")
|
metrics_counter_get = get_metrics_value(node, command="grpc_server_handled_total", service="ObjectService", method="Get")
|
||||||
|
|
||||||
with reporter.step(f"Get object"):
|
with reporter.step(f"Get object"):
|
||||||
get_object(default_wallet, container, oid, self.shell, node.storage_node.get_rpc_endpoint())
|
for _ in range(operations_count):
|
||||||
|
get_object(default_wallet, container, oid, self.shell, node.storage_node.get_rpc_endpoint())
|
||||||
|
|
||||||
with reporter.step(f"Check gRPC metrics method=Get, 'the counter should increase by 1'"):
|
with reporter.step(f"Check gRPC metrics method=Get, 'the counter should increase by {operations_count}'"):
|
||||||
metrics_counter_get += 1
|
metrics_counter_get += operations_count
|
||||||
check_metrics_counter(
|
check_metrics_counter(
|
||||||
[node],
|
[node],
|
||||||
|
operator=">=",
|
||||||
counter_exp=metrics_counter_get,
|
counter_exp=metrics_counter_get,
|
||||||
command="grpc_server_handled_total",
|
command="grpc_server_handled_total",
|
||||||
service="ObjectService",
|
service="ObjectService",
|
||||||
|
@ -129,12 +139,14 @@ class TestGRPCMetrics(ClusterTestBase):
|
||||||
metrics_counter_search = get_metrics_value(node, command="grpc_server_handled_total", service="ObjectService", method="Search")
|
metrics_counter_search = get_metrics_value(node, command="grpc_server_handled_total", service="ObjectService", method="Search")
|
||||||
|
|
||||||
with reporter.step(f"Search object"):
|
with reporter.step(f"Search object"):
|
||||||
search_object(default_wallet, container, self.shell, node.storage_node.get_rpc_endpoint())
|
for _ in range(operations_count):
|
||||||
|
search_object(default_wallet, container, self.shell, node.storage_node.get_rpc_endpoint())
|
||||||
|
|
||||||
with reporter.step(f"Check gRPC metrics method=Search, 'the counter should increase by 1'"):
|
with reporter.step(f"Check gRPC metrics method=Search, 'the counter should increase by {operations_count}'"):
|
||||||
metrics_counter_search += 1
|
metrics_counter_search += operations_count
|
||||||
check_metrics_counter(
|
check_metrics_counter(
|
||||||
[node],
|
[node],
|
||||||
|
operator=">=",
|
||||||
counter_exp=metrics_counter_search,
|
counter_exp=metrics_counter_search,
|
||||||
command="grpc_server_handled_total",
|
command="grpc_server_handled_total",
|
||||||
service="ObjectService",
|
service="ObjectService",
|
||||||
|
@ -145,12 +157,14 @@ class TestGRPCMetrics(ClusterTestBase):
|
||||||
metrics_counter_head = get_metrics_value(node, command="grpc_server_handled_total", service="ObjectService", method="Head")
|
metrics_counter_head = get_metrics_value(node, command="grpc_server_handled_total", service="ObjectService", method="Head")
|
||||||
|
|
||||||
with reporter.step(f"Head object"):
|
with reporter.step(f"Head object"):
|
||||||
head_object(default_wallet, container, oid, self.shell, node.storage_node.get_rpc_endpoint())
|
for _ in range(operations_count):
|
||||||
|
head_object(default_wallet, container, oid, self.shell, node.storage_node.get_rpc_endpoint())
|
||||||
|
|
||||||
with reporter.step(f"Check gRPC metrics method=Head, 'the counter should increase by 1'"):
|
with reporter.step(f"Check gRPC metrics method=Head, 'the counter should increase by {operations_count}'"):
|
||||||
metrics_counter_head += 1
|
metrics_counter_head += operations_count
|
||||||
check_metrics_counter(
|
check_metrics_counter(
|
||||||
[node],
|
[node],
|
||||||
|
operator=">=",
|
||||||
counter_exp=metrics_counter_head,
|
counter_exp=metrics_counter_head,
|
||||||
command="grpc_server_handled_total",
|
command="grpc_server_handled_total",
|
||||||
service="ObjectService",
|
service="ObjectService",
|
||||||
|
|
Loading…
Reference in a new issue