Commit cb744a87 authored by Pascal Engélibert's avatar Pascal Engélibert 🚴
Browse files

Graph -> Charts, readme

parent e9b8d03f
......@@ -6,9 +6,23 @@ This program generates random ĞMixer transactions with given parameters, then r
## Use
`gmixer_analyzer --help` to display help
`./gmixer_analyzer --help` to display help
Standard output is the results in JSON format.
### Simulate & analyze
`local` subcommand takes commandline settings and writes to stdout the results in specified format (`-e` option, default `bincode`).
# Run with default settings
./gmixer_analyzer local > results.bincode
# Display help
./gmixer_analyzer local --help
### Draw charts
`charts` subcommand takes stdin as data and writes `security.png` and `effectiveness.png`.
cat results.bincode | ./gmixer_analyzer charts -i bincode
## License
......
......@@ -7,7 +7,7 @@ use serde_cbor;
use serde_json;
use std::{collections::HashMap, io::Read};
pub fn run_graph(opt: cli::GraphSubcommand) {
pub fn run_charts(opt: cli::ChartsSubcommand) {
let stdin = std::io::stdin();
let mut handle = stdin.lock();
let mut raw = Vec::new();
......
mod charts;
mod client;
mod common;
mod convert;
mod graph;
mod local;
mod server;
mod utils;
......@@ -23,7 +23,7 @@ fn main() {
match opt.cmd {
cli::MainSubcommand::Client(cmd) => client::run_client(cmd),
cli::MainSubcommand::Convert(cmd) => convert::run_convert(cmd),
cli::MainSubcommand::Graph(cmd) => graph::run_graph(cmd),
cli::MainSubcommand::Charts(cmd) => charts::run_charts(cmd),
cli::MainSubcommand::Local(cmd) => local::run_local(cmd),
cli::MainSubcommand::Server(cmd) => server::run_server(cmd),
}
......
......@@ -2,6 +2,12 @@ use crate::common::*;
use structopt::StructOpt;
#[derive(Debug, StructOpt)]
pub struct ChartsSubcommand {
#[structopt(short = "i")]
pub input_format: ExportFormat,
}
#[derive(Debug, StructOpt)]
pub struct ClientSubcommand {}
......@@ -32,20 +38,14 @@ pub struct LocalSubcommand {
pub settings: Settings,
}
#[derive(Debug, StructOpt)]
pub struct GraphSubcommand {
#[structopt(short = "i")]
pub input_format: ExportFormat,
}
#[derive(Debug, StructOpt)]
pub struct ServerSubcommand {}
#[derive(Debug, StructOpt)]
pub enum MainSubcommand {
Charts(ChartsSubcommand),
Client(ClientSubcommand),
Convert(ConvertSubcommand),
Graph(GraphSubcommand),
Local(LocalSubcommand),
Server(ServerSubcommand),
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment