Skip to content

Commit

Permalink
feat(iroh-cli): add doctor plot (#2206)
Browse files Browse the repository at this point in the history
## Description

Allows for quick plotting of prometheus style metrics. By default it
looks at `http://localhost:9090` but can be configured.
When the plotter app is active you can freeze the state by pressing `f`
or quit by pressing `q`.
A magic metric named `random` can be used for demo purposes and simply
generates a 1-100 value on every tick.

Sample usage:
`iroh doctor plot
magicsock_relay_home_change_total,iroh_requests_total_total,random`

Still got some cleanup to do and some sanity checking so we don't blow
up in some cases.

<img width="1950" alt="Screenshot 2024-04-18 at 00 27 01"
src="https://github.com/n0-computer/iroh/assets/1760977/6c964a7b-4447-4027-b24e-4d8c34852e7a">


## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [ ] Self-review.
- [ ] Documentation updates if relevant.
- [ ] Tests if relevant.
  • Loading branch information
Arqu committed May 13, 2024
1 parent 5343cea commit 4f1d8b0
Show file tree
Hide file tree
Showing 3 changed files with 407 additions and 3 deletions.
111 changes: 109 additions & 2 deletions Cargo.lock

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

5 changes: 4 additions & 1 deletion iroh-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ clap = { version = "4", features = ["derive"] }
colored = "2.0.4"
comfy-table = "7.0.1"
console = "0.15.5"
derive_more = { version = "1.0.0-beta.6", features = ["display"] }
crossterm = "0.27.0"
derive_more = { version = "1.0.0-beta.1", features = ["display"] }
dialoguer = { version = "0.11.0", default-features = false }
dirs-next = "2.0.0"
flume = "0.11.0"
Expand All @@ -46,6 +47,8 @@ portable-atomic = "1"
postcard = "1.0.8"
quic-rpc = { version = "0.9.0", features = ["flume-transport", "quinn-transport"] }
rand = "0.8.5"
ratatui = "0.26.2"
reqwest = { version = "0.11.19", default-features = false, features = ["json", "rustls-tls"] }
rustyline = "12.0.0"
serde = { version = "1.0.197", features = ["derive"] }
serde_with = "3.7.0"
Expand Down

0 comments on commit 4f1d8b0

Please sign in to comment.