pub struct TopArgs {
pub metrics_url: Option<String>,
pub config: Option<PathBuf>,
pub interval_ms: u64,
pub json: bool,
pub timeout_ms: u64,
}Expand description
decdn node top — live metrics view (issue #275).
Polls the daemon’s loopback /metrics HTTP endpoint every
--interval-ms and redraws a fixed-column table with current
gauges, per-second counter deltas, and a derived cache hit-rate.
The metrics port is loopback-only by default
(observability.metrics_bind = 127.0.0.1); operators who exposed
it elsewhere should pass --metrics-url.
Fields§
§metrics_url: Option<String>Base URL of the node’s metrics HTTP endpoint, e.g.
http://127.0.0.1:9090. Also read from DECDN_METRICS_URL
when unset. If still unset, the port is derived from
observability.metrics_port in the config file (see
--config); the host is always 127.0.0.1 because the
metrics endpoint is loopback-only by default.
config: Option<PathBuf>Path to the TOML config file used to derive the metrics URL
when --metrics-url / DECDN_METRICS_URL are unset. Same
resolution semantics as decdn node health --config.
interval_ms: u64Refresh interval in milliseconds. Default 1000 (one Hz, matches the issue title). Values below 100ms are accepted but unlikely to outpace the operator’s terminal redraw budget.
json: boolSingle-shot mode: fetch once, emit the snapshot as pretty JSON, and exit. Useful for scripts or one-off captures. Mutually exclusive with the live redraw loop (which runs forever in plain mode until Ctrl-C).
timeout_ms: u64HTTP roundtrip timeout in milliseconds for each /metrics
scrape. A scrape that times out is logged and the loop
continues — the displayed counters keep their last value
rather than the table going blank on a single hiccup.
Trait Implementations§
Source§impl Args for TopArgs
impl Args for TopArgs
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl FromArgMatches for TopArgs
impl FromArgMatches for TopArgs
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Auto Trait Implementations§
impl Freeze for TopArgs
impl RefUnwindSafe for TopArgs
impl Send for TopArgs
impl Sync for TopArgs
impl Unpin for TopArgs
impl UnsafeUnpin for TopArgs
impl UnwindSafe for TopArgs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more