Gather some runtime stats

This commit is contained in:
Dominik Werder
2022-05-10 15:48:25 +02:00
parent a964e49aa6
commit eee67b916f
10 changed files with 502 additions and 182 deletions
+12 -4
View File
@@ -3,13 +3,14 @@ use daqingest::{ChannelAccess, DaqIngestOpts, SubCmd};
use err::Error;
pub fn main() -> Result<(), Error> {
taskrun::run(async {
let opts = DaqIngestOpts::parse();
log::info!("daqingest version {}", clap::crate_version!());
let runtime = taskrun::get_runtime_opts(opts.nworkers.unwrap_or(12), 32);
let res = runtime.block_on(async move {
if false {
return Err(Error::with_msg_no_trace(format!("unknown command")));
} else {
}
let opts = DaqIngestOpts::parse();
log::info!("daqingest version {}", clap::crate_version!());
match opts.subcmd {
SubCmd::Bsread(k) => netfetch::zmtp::zmtp_client(k.into()).await?,
SubCmd::ListPkey => daqingest::query::list_pkey().await?,
@@ -26,5 +27,12 @@ pub fn main() -> Result<(), Error> {
},
}
Ok(())
})
});
match res {
Ok(k) => Ok(k),
Err(e) => {
log::error!("Catched: {:?}", e);
Err(e)
}
}
}
+2
View File
@@ -14,6 +14,8 @@ pub struct DaqIngestOpts {
pub tag: Option<String>,
#[clap(subcommand)]
pub subcmd: SubCmd,
#[clap(long)]
pub nworkers: Option<usize>,
}
#[derive(Debug, Parser)]