Skip to content

Commit

Permalink
feat: basic kratactl top command (#72)
Browse files Browse the repository at this point in the history
* feat: basic kratactl top command

* fix: use magic bytes 0xff 0xff in idm to improve reliability
  • Loading branch information
azenla authored Apr 14, 2024
1 parent 1627cbc commit 0a6a112
Show file tree
Hide file tree
Showing 11 changed files with 548 additions and 12 deletions.
132 changes: 132 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ prost-build = "0.12.4"
prost-reflect-build = "0.13.0"
prost-types = "0.12.4"
rand = "0.8.5"
ratatui = "0.26.1"
redb = "2.0.0"
rtnetlink = "0.14.1"
scopeguard = "1.2.0"
Expand Down
3 changes: 2 additions & 1 deletion crates/ctl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ anyhow = { workspace = true }
async-stream = { workspace = true }
clap = { workspace = true }
comfy-table = { workspace = true }
crossterm = { workspace = true }
crossterm = { workspace = true, features = ["event-stream"] }
ctrlc = { workspace = true, features = ["termination"] }
env_logger = { workspace = true }
fancy-duration = { workspace = true }
Expand All @@ -23,6 +23,7 @@ krata = { path = "../krata", version = "^0.0.8" }
log = { workspace = true }
prost-reflect = { workspace = true, features = ["serde"] }
prost-types = { workspace = true }
ratatui = { workspace = true }
serde_json = { workspace = true }
serde_yaml = { workspace = true }
termtree = { workspace = true }
Expand Down
8 changes: 7 additions & 1 deletion crates/ctl/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pub mod list;
pub mod logs;
pub mod metrics;
pub mod resolve;
pub mod top;
pub mod watch;

use anyhow::{anyhow, Result};
Expand All @@ -20,7 +21,7 @@ use tonic::{transport::Channel, Request};
use self::{
attach::AttachCommand, destroy::DestroyCommand, idm_snoop::IdmSnoopCommand,
launch::LauchCommand, list::ListCommand, logs::LogsCommand, metrics::MetricsCommand,
resolve::ResolveCommand, watch::WatchCommand,
resolve::ResolveCommand, top::TopCommand, watch::WatchCommand,
};

#[derive(Parser)]
Expand Down Expand Up @@ -52,6 +53,7 @@ pub enum Commands {
Resolve(ResolveCommand),
Metrics(MetricsCommand),
IdmSnoop(IdmSnoopCommand),
Top(TopCommand),
}

impl ControlCommand {
Expand Down Expand Up @@ -95,6 +97,10 @@ impl ControlCommand {
Commands::IdmSnoop(snoop) => {
snoop.run(client, events).await?;
}

Commands::Top(top) => {
top.run(client, events).await?;
}
}
Ok(())
}
Expand Down
Loading

0 comments on commit 0a6a112

Please sign in to comment.