feat: basic kratactl top command (#72)

* feat: basic kratactl top command

* fix: use magic bytes 0xff 0xff in idm to improve reliability
This commit is contained in:
Alex Zenla
2024-04-14 15:32:34 -07:00
committed by GitHub
parent 1627cbcdd7
commit 0a6a112133
11 changed files with 548 additions and 12 deletions

View File

@ -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};
@ -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)]
@ -52,6 +53,7 @@ pub enum Commands {
Resolve(ResolveCommand),
Metrics(MetricsCommand),
IdmSnoop(IdmSnoopCommand),
Top(TopCommand),
}
impl ControlCommand {
@ -95,6 +97,10 @@ impl ControlCommand {
Commands::IdmSnoop(snoop) => {
snoop.run(client, events).await?;
}
Commands::Top(top) => {
top.run(client, events).await?;
}
}
Ok(())
}