Skip to content

Commit

Permalink
feat: metrics dumps & extended metrics (#2519)
Browse files Browse the repository at this point in the history
## Description

Extends several pieces:
- introduces a "metric dumper" which is just a way of saying you can
sample the internal metrics and write them to a CSV file (which should
come in handy for 3 pieces that should come down the line; 1) CI using
these to validate behavior, 2) debug dumps from 3rd parties, 3) local
debugging)
- along with the dumper the `doctor plot` has been extended to be able
to read those dumps and also just generally improved some rough edges so
it's less error prone.
- node counts are here for relays. You now have a derived metric which
simply counts unique daily node connections.


Sample usage for the metrics dumper:
`cargo run --bin iroh --all-features -- --metrics-dump-path
test.metrics.csv start`

Sample of the plotter:
`cargo run --bin iroh --all-features -- doctor plot --timeframe 30
--interval 10 --file metrics.dump.csv
magicsock_actor_tick_main_total,magicsock_actor_tick_msg_total,magicsock_actor_tick_endpoint_heartbeat_total,magicsock_actor_tick_endpoints_update_receiver_total,magicsock_actor_tick_re_stun_total`

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

This is merging into #2464 as
part of the larger metrics refactor.

## Change checklist

- [ ] Self-review.
- [ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [ ] Tests if relevant.
- [ ] All breaking changes documented.
  • Loading branch information
Arqu committed Jul 22, 2024
1 parent 049a2c4 commit 029010e
Show file tree
Hide file tree
Showing 13 changed files with 379 additions and 107 deletions.
116 changes: 59 additions & 57 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion iroh-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ portable-atomic = "1"
postcard = "1.0.8"
quic-rpc = { version = "0.11", features = ["flume-transport", "quinn-transport"] }
rand = "0.8.5"
ratatui = "0.26.2"
ratatui = "0.27"
reqwest = { version = "0.12.4", default-features = false, features = ["json", "rustls-tls"] }
rustyline = "12.0.0"
serde = { version = "1.0.197", features = ["derive"] }
Expand Down
Loading

0 comments on commit 029010e

Please sign in to comment.