mirror of
https://github.com/vacp2p/status-benchmarks.git
synced 2026-01-07 21:54:06 -05:00
Add store_performance (#30)
This commit is contained in:
@@ -67,3 +67,60 @@ async def subscription_performance():
|
||||
await asyncio.gather(*[node.shutdown() for node in relay_nodes.values()])
|
||||
await asyncio.gather(*[node.shutdown() for node in light_nodes.values()])
|
||||
logger.info("Finished subscription_performance")
|
||||
|
||||
|
||||
async def store_performance():
|
||||
# 1 publisher node
|
||||
# 1-2 service nodes
|
||||
# 200 light nodes
|
||||
# 200 relay nodes
|
||||
# One community setup
|
||||
# All relay and light nodes have joined the community
|
||||
# -> Only publisher and service nodes are up
|
||||
# -> publisher node publishes messages (they get stored in store), then stops
|
||||
# -> light and relay nodes go online
|
||||
# -> They automatically perform store queries
|
||||
# -> Measure time from start to time they get first query
|
||||
# -> Measure on wire store query performance
|
||||
kube_utils.setup_kubernetes_client()
|
||||
backend_relay_pods = kube_utils.get_pods("status-backend-relay", "status-go-test")
|
||||
backend_light_pods = kube_utils.get_pods("status-backend-light", "status-go-test")
|
||||
|
||||
relay_nodes, light_nodes = await asyncio.gather(
|
||||
setup_status.initialize_nodes_application(backend_relay_pods),
|
||||
setup_status.initialize_nodes_application(backend_light_pods, wakuV2LightClient=True)
|
||||
)
|
||||
|
||||
name = f"test_community_{''.join(random.choices(string.ascii_letters, k=10))}"
|
||||
logger.info(f"Creating community {name}")
|
||||
response = await relay_nodes["status-backend-relay-0"].wakuext_service.create_community(name)
|
||||
community_id = response.get("result", {}).get("communities", [{}])[0].get("id")
|
||||
logger.info(f"Community {name} created with ID {community_id}")
|
||||
|
||||
owner = relay_nodes["status-backend-relay-0"]
|
||||
nodes = [key for key in relay_nodes.keys() if key != "status-backend-relay-0"]
|
||||
|
||||
joins_ids_relay, join_ids_light = await asyncio.gather(
|
||||
request_join_nodes_to_community(relay_nodes, nodes, community_id),
|
||||
request_join_nodes_to_community(light_nodes, light_nodes.keys(), community_id)
|
||||
)
|
||||
|
||||
chat_id_relays, chat_id_lights = await asyncio.gather(
|
||||
accept_community_requests(owner, joins_ids_relay),
|
||||
accept_community_requests(owner, join_ids_light),
|
||||
)
|
||||
|
||||
await asyncio.gather(*[relay_nodes[node].logout() for node in nodes])
|
||||
await asyncio.gather(*[node.logout() for node in light_nodes.values()])
|
||||
|
||||
await inject_messages(owner, 1, community_id + chat_id_relays, 30)
|
||||
|
||||
await asyncio.gather(*[relay_nodes[node].login(relay_nodes[node].find_key_uid()) for node in nodes])
|
||||
await asyncio.gather(*[node.login(node.find_key_uid()) for node in light_nodes.values()])
|
||||
|
||||
await asyncio.sleep(10) # Some time to receive signals
|
||||
|
||||
logger.info("Shutting down node connections")
|
||||
await asyncio.gather(*[node.shutdown() for node in relay_nodes.values()])
|
||||
await asyncio.gather(*[node.shutdown() for node in light_nodes.values()])
|
||||
logger.info("Finished store_performance")
|
||||
|
||||
Reference in New Issue
Block a user