From dd81618fbc42f741d13217628b4abff53a5e00b0 Mon Sep 17 00:00:00 2001 From: ThetaSinner Date: Thu, 7 Mar 2024 14:17:47 +0000 Subject: [PATCH] Catch first scenario up with runner helpers and add doc --- scenarios/zome_call_single_value/README.md | 12 ++++++++++++ scenarios/zome_call_single_value/src/main.rs | 16 +--------------- 2 files changed, 13 insertions(+), 15 deletions(-) create mode 100644 scenarios/zome_call_single_value/README.md diff --git a/scenarios/zome_call_single_value/README.md b/scenarios/zome_call_single_value/README.md new file mode 100644 index 00000000..bb0dd5cb --- /dev/null +++ b/scenarios/zome_call_single_value/README.md @@ -0,0 +1,12 @@ +## zome_call_single_value + +### Description + +Calls a zome function that returns a fixed value. This tests the maximum performance of zome calls when the zome +function is not calling into Holochain other otherwise doing any work. + +### Suggested run + +```bash +RUST_LOG=info cargo run --package zome_call_single_value -- --connection-string ws://localhost:8888 --duration 900 +``` diff --git a/scenarios/zome_call_single_value/src/main.rs b/scenarios/zome_call_single_value/src/main.rs index 0ddf4c62..9e02f5dc 100644 --- a/scenarios/zome_call_single_value/src/main.rs +++ b/scenarios/zome_call_single_value/src/main.rs @@ -24,21 +24,7 @@ fn agent_setup( fn agent_behaviour( ctx: &mut AgentContext, ) -> HookResult { - let cell_id = ctx.get().cell_id(); - let mut app_agent_client = ctx.get().app_agent_client(); - ctx.runner_context().executor().execute_in_place(async { - app_agent_client - .call_zome( - cell_id.into(), - "return_single_value".into(), - "get_value".into(), - ExternIO::encode(()).context("Encoding failure")?, - ) - .await - .map_err(|e| anyhow::anyhow!("Conductor API error: {:?}", e))?; - - Ok(()) - })?; + let _: usize = call_zome(ctx, "return_single_value", "get_value", ())?; Ok(()) }