diff --git a/radicle-cli/src/commands.rs b/radicle-cli/src/commands.rs index 22a78700..7668cabc 100644 --- a/radicle-cli/src/commands.rs +++ b/radicle-cli/src/commands.rs @@ -42,6 +42,8 @@ pub mod rad_remote; pub mod rad_seed; #[path = "commands/self.rs"] pub mod rad_self; +#[path = "commands/stats.rs"] +pub mod rad_stats; #[path = "commands/sync.rs"] pub mod rad_sync; #[path = "commands/unfollow.rs"] diff --git a/radicle-cli/src/commands/help.rs b/radicle-cli/src/commands/help.rs index dbd5342c..9ee331b5 100644 --- a/radicle-cli/src/commands/help.rs +++ b/radicle-cli/src/commands/help.rs @@ -32,6 +32,7 @@ const COMMANDS: &[Help] = &[ rad_follow::HELP, rad_unfollow::HELP, rad_remote::HELP, + rad_stats::HELP, rad_sync::HELP, ]; diff --git a/radicle-cli/src/commands/stats.rs b/radicle-cli/src/commands/stats.rs new file mode 100644 index 00000000..d99d22a5 --- /dev/null +++ b/radicle-cli/src/commands/stats.rs @@ -0,0 +1,175 @@ +use std::ffi::OsString; +use std::path::Path; + +use localtime::LocalDuration; +use localtime::LocalTime; +use radicle::cob::issue; +use radicle::cob::patch; +use radicle::git; +use radicle::node::address; +use radicle::node::routing; +use radicle::storage::{ReadRepository, ReadStorage, WriteRepository}; +use radicle_term::Element; +use serde::Serialize; + +use crate::terminal as term; +use crate::terminal::args::{Args, Error, Help}; + +pub const HELP: Help = Help { + name: "stats", + description: "Displays aggregated repository and node metrics", + version: env!("CARGO_PKG_VERSION"), + usage: r#" +Usage + + rad stats [