subbeat
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
662 B

3 years ago
use subbeat::datasources::resolve;
3 years ago
3 years ago
mod cli;
3 years ago
mod types;
3 years ago
#[tokio::main]
async fn main() -> types::Result<()> {
3 years ago
let cli = cli::CLI::new();
3 years ago
let ds = resolve(&cli.query_config.datasource_config);
3 years ago
let r = ds
.query(
3 years ago
cli.query_config.from,
cli.query_config.to,
cli.query_config.step,
)
3 years ago
.await?;
3 years ago
if r.data.keys().len() > 0 {
let key = r.data.keys().nth(0).unwrap();
println!("timestamp\t{}", key);
let vs = &r.data[key];
for (t, v) in vs.iter() {
println!("{}\t{}", t, v);
}
} else {
println!("no_data");
3 years ago
}
Ok(())
3 years ago
}