Skip to content

Commit

Permalink
Docs for custom metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
ThetaSinner committed Mar 8, 2024
1 parent c9e9abc commit 8885ab4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,22 @@ fn agent_behaviour(ctx: &mut AgentContext<HolochainRunnerContext, HolochainAgent
}
```

#### Record custom metrics

This is useful for scenarios that need to measure things that don't happen through the instrumented client that is talking to the system under test.

```rust
fn agent_behaviour(ctx: &mut AgentContext<HolochainRunnerContext, HolochainAgentContext>) -> 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
Expand Down

0 comments on commit 8885ab4

Please sign in to comment.