adding wf utility
This commit is contained in:
parent
08fcab41d3
commit
4dea51999e
@@ -18,3 +18,5 @@ users = { version = "0.11", optional = true }
|
|||||||
psutil = { version = "3.2", features = ["process"] }
|
psutil = { version = "3.2", features = ["process"] }
|
||||||
sysinfo = "0.23"
|
sysinfo = "0.23"
|
||||||
redis = { version = "*", features = ["aio", "tokio-comp"] }
|
redis = { version = "*", features = ["aio", "tokio-comp"] }
|
||||||
|
clap = { version = "3.1", features = ["derive"] }
|
||||||
|
env_logger = "0.9"
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
use clap::Parser;
|
||||||
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use waterfall::executors::local_executor;
|
||||||
|
use waterfall::runner::Runner;
|
||||||
|
use waterfall::storage::redis_store;
|
||||||
|
use waterfall::world::WorldDefinition;
|
||||||
|
|
||||||
|
#[derive(Parser, Debug)]
|
||||||
|
#[clap(author, version, about)]
|
||||||
|
struct Args {
|
||||||
|
/// Configuration File
|
||||||
|
#[clap(short, long, default_value = "")]
|
||||||
|
config: String,
|
||||||
|
|
||||||
|
/// Configuration File
|
||||||
|
#[clap(short, long, default_value = "")]
|
||||||
|
world: String,
|
||||||
|
|
||||||
|
/// Enable verbose logging
|
||||||
|
#[clap(short, long)]
|
||||||
|
verbose: bool,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() -> std::io::Result<()> {
|
||||||
|
let args = Args::parse();
|
||||||
|
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));
|
||||||
|
|
||||||
|
let json = std::fs::read_to_string(&args.config)
|
||||||
|
.expect(&format!("Unable to open {} for reading", args.config));
|
||||||
|
|
||||||
|
// Some Deserializer.
|
||||||
|
let world_def: WorldDefinition =
|
||||||
|
serde_json::from_str(&json).expect("Unable to parse world definition");
|
||||||
|
|
||||||
|
let tasks = world_def.taskset().unwrap();
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user