agave_validator/commands/monitor/
mod.rs

1use {
2    crate::{commands::Result, dashboard::Dashboard},
3    clap::{App, ArgMatches, SubCommand},
4    std::{path::Path, time::Duration},
5};
6
7pub fn command<'a>() -> App<'a, 'a> {
8    SubCommand::with_name("monitor").about("Monitor the validator")
9}
10
11pub fn execute(_matches: &ArgMatches, ledger_path: &Path) -> Result<()> {
12    monitor_validator(ledger_path)
13}
14
15pub fn monitor_validator(ledger_path: &Path) -> Result<()> {
16    let dashboard = Dashboard::new(ledger_path, None, None);
17    dashboard.run(Duration::from_secs(2));
18
19    Ok(())
20}