#benchmark #mcai #worker #statistics #version1

mcai-benchmark

Library to benchmark MCAI workers

2 unstable releases

0.3.0 Jul 21, 2022
0.2.0 Jul 4, 2022

#10 in #mcai

26 downloads per month
Used in mcai

MIT license

35KB
987 lines

MCAI Benchmark

Crate to benchmark MCAI workers based on a configuration.


lib.rs:

MCAI Benchmark

This crate allows to benchmarl MCAI wroker based on a configuration file.

Configuration

This is a sample configuration file.

version: 1
output_folder: "./output_folder"
worker_docker_image: "image_name"

my_benchmark_name:
  source_order: "source_order_filename"
  iterations: 5
  hardware:
  cpu:
    - 1
    - 2
  memory:
    - 2048
  envs:
    EXAMPLE_VAR: "my_example_var"
  volumes:
    - host: /path/to/a/volume
      container: /volume
      readonly: true

Usage

use mcai_benchmark::{
    benchmark::result::Results,
    configuration::{Configuration, Version1},
    stats::ConsoleWriter,
};
use std::sync::{Arc, Mutex};

#[tokio::main]
async fn main() {
    let config = Version1::read_from_file("./examples/sample_config.yaml").unwrap();
    let mut benchmark = Results::from(Configuration::Version1(config));

    if let Err(error) = benchmark
        .run_benchmark(Some(Arc::new(Mutex::new(ConsoleWriter {}))))
        .await
    {
        println!("Error: {:?}", error);
    }

    println!("{:?}", benchmark);
}

Dependencies

~22–35MB
~557K SLoC