8 releases
0.0.8 | Jul 26, 2023 |
---|---|
0.0.7 | Jul 25, 2023 |
#34 in Simulation
132 downloads per month
605KB
1.5K
SLoC
Simulon
A network (latency) simulation engine to simulate complex distributed systems at scale. Checkout the examples directory to see the usage of the API. use std::time::Duration;
Example
use simulon::{api, simulation::SimulationBuilder};
async fn exec() {
// Use api::* to do cool stuff. Like connecting to other nodes, listening on a port and
// more.
}
pub fn main() {
// Build a simulator with the provided executor function and simulate for
// 10 simulated seconds.
SimulationBuilder::new(|| api::spawn(exec()))
// Specify the number of nodes.
.with_nodes(10_000)
// Don't collect metrics for indivisual nodes at each time frame.
.set_node_metrics_rate(Duration::ZERO)
.enable_progress_bar()
.run(Duration::from_secs(10));
}
lib.rs
:
Simulon is a lite discrete event simulation engine used for simulating latency sensitive IO bound applications. It provides a small set of API that can be used inside of a simulation to interact with other nodes in the same simulation, and perform basic IO.
Dependencies
~4–14MB
~154K SLoC