Skip to content

Commit 877ae05

Browse files
committed
formatter
1 parent e0815ac commit 877ae05

File tree

5 files changed

+5
-11
lines changed

5 files changed

+5
-11
lines changed

src/lib.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1+
use core_affinity::CoreId;
12
use serde::Deserialize;
23
use std::fmt::Display;
3-
use core_affinity::CoreId;
44

55
pub mod worker;
66

77
/// Main workload configuration, contains general bits for all types of
88
/// workloads plus workload specific data.
99
#[derive(Debug, Copy, Clone, Deserialize)]
1010
pub struct WorkloadConfig {
11-
1211
/// An amount of time for workload payload to run before restarting.
1312
pub restart_interval: u64,
1413

@@ -21,18 +20,15 @@ pub struct WorkloadConfig {
2120
#[derive(Debug, Copy, Clone, Deserialize)]
2221
#[serde(rename_all = "lowercase", tag = "type")]
2322
pub enum Workload {
24-
2523
/// How to listen on ports.
2624
Endpoints {
27-
2825
/// Governing the number of ports open.
2926
#[serde(flatten)]
3027
distribution: Distribution,
3128
},
3229

3330
/// How to spawn processes.
3431
Processes {
35-
3632
/// How often a new process will be spawn.
3733
arrival_rate: f64,
3834

@@ -45,7 +41,6 @@ pub enum Workload {
4541

4642
/// How to invoke syscalls
4743
Syscalls {
48-
4944
/// How often to invoke a syscall.
5045
arrival_rate: f64,
5146
},
@@ -55,7 +50,6 @@ pub enum Workload {
5550
#[derive(Debug, Copy, Clone, Deserialize)]
5651
#[serde(tag = "distribution")]
5752
pub enum Distribution {
58-
5953
/// Few processes are opening large number of ports, the rest are only few.
6054
#[serde(alias = "zipf")]
6155
Zipfian { n_ports: u64, exponent: f64 },

src/worker/endpoints.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::{fmt::Display, net::TcpListener, thread, time};
33
use core_affinity::CoreId;
44
use log::info;
55

6-
use crate::{WorkloadConfig, BaseConfig, Worker, WorkerError};
6+
use crate::{BaseConfig, Worker, WorkerError, WorkloadConfig};
77

88
struct EndpointWorkload {
99
restart_interval: u64,

src/worker/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use core_affinity::CoreId;
22
use rand::{thread_rng, Rng};
33
use rand_distr::{Uniform, Zipf};
44

5-
use crate::{Distribution, Workload, WorkloadConfig, Worker};
5+
use crate::{Distribution, Worker, Workload, WorkloadConfig};
66

77
use self::{endpoints::EndpointWorker, processes::ProcessesWorker, syscalls::SyscallsWorker};
88

src/worker/processes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use nix::{sys::wait::waitpid, unistd::Pid};
77
use rand::{distributions::Alphanumeric, thread_rng, Rng};
88
use rand_distr::Exp;
99

10-
use crate::{Workload, WorkloadConfig, BaseConfig, Worker, WorkerError};
10+
use crate::{BaseConfig, Worker, WorkerError, Workload, WorkloadConfig};
1111

1212
#[derive(Debug, Clone, Copy)]
1313
pub struct ProcessesWorker {

src/worker/syscalls.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use rand::{thread_rng, Rng};
66
use rand_distr::Exp;
77
use syscalls::{syscall, Sysno};
88

9-
use crate::{Workload, WorkloadConfig, BaseConfig, Worker, WorkerError};
9+
use crate::{BaseConfig, Worker, WorkerError, Workload, WorkloadConfig};
1010

1111
#[derive(Debug, Copy, Clone)]
1212
pub struct SyscallsWorker {

0 commit comments

Comments
 (0)