Expand description
Deterministic & fast simulation framework for distributed systems.
DScale provides a single-threaded or parallel, event-driven simulation engine that models network latency, bandwidth constraints, and process execution. Simulations are fully deterministic when seeded, making them reproducible for testing and benchmarking.
The main workflow:
- Define messages implementing
Message. - Implement
Processfor your process logic. - Configure the simulation with
SimulationBuilder. - Call
run_X()on the result ofSimulationBuilder::build.
Re-exports§
pub use services::broadcast;pub use services::broadcast_within_pool;pub use services::choose_from_pool;pub use services::list_pool;pub use services::now;pub use services::pid;pub use services::schedule_timer_after;pub use services::send_random;pub use services::send_random_from_pool;pub use services::send_to;pub use services::unique_id;pub use log;pub use rand;
Modules§
- helpers
- Helper utilities for simulation processes.
- services
- Services to use with simulation: key-value store, process interaction, uid generator.
Macros§
- dscale_
debug - Logs at debug level. See
dscale_log. - dscale_
error - Logs at error level. See
dscale_log. - dscale_
info - Logs at info level. See
dscale_log. - dscale_
log - Logs at the given level, prefixed with simulation time and process pid.
Controlled by the
RUST_LOGenvironment variable. - dscale_
trace - Logs at trace level. See
dscale_log. - dscale_
warn - Logs at warn level. See
dscale_log.
Structs§
- Jiffies
- The simulation time unit. One jiffy is the smallest discrete time step.
- Simulation
Builder - Builder for configuring and constructing a simulation.
Enums§
- Bandwidth
Config - Per-process NIC bandwidth configuration.
- Complete
Status - Outcome of a simulation run.
- Distr
- Probability Distributions used to sample network latencies.
- Message
Ptr - Reference-counted wrapper around a
Message. - Thread
Number - Represents how many threads will be used to run steps in parallel.
Constants§
- GLOBAL_
POOL - Name of the implicit pool that contains every process.
Traits§
- Message
- Trait for values that can be sent between simulated processes.
- Process
- Core trait for defining process behavior in the simulation.
- Simulation
Runner - Execution engine returned by
crate::SimulationBuilder::build.