From 8885ab4c9150e21952e2cf40f23c46efad533e77 Mon Sep 17 00:00:00 2001 From: ThetaSinner Date: Fri, 8 Mar 2024 16:40:07 +0000 Subject: [PATCH] Docs for custom metrics --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index c0ca296d..9e1826be 100644 --- a/README.md +++ b/README.md @@ -218,6 +218,22 @@ fn agent_behaviour(ctx: &mut AgentContext) -> HookResult { + let metric = ReportMetric::new("my_custom_metric") + .with_field("value", 1); + ctx.runner_context().reporter().clone().add_custom(metric); + + Ok(()) +} +``` + +The metric will appear in InfluxDB as `wt.custom.my_custom_metric` with a field `value` set to `1`. + ### Running scenarios locally When developing your scenarios you can disable anything that requires running infrastructure, other than the target system. However, once you