Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions examples/benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut sessions = JoinSet::new();
let mut reports = Vec::new();
let mut spawned_sessions = 0usize;
let mut next_session_id = 1usize;

spawn_session(
&mut sessions,
next_session_id,
spawned_sessions,
Arc::clone(&model),
license.clone(),
config.clone(),
Expand All @@ -85,10 +84,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let first_failed_report = loop {
tokio::select! {
_ = spawn_ticks.tick() => {
next_session_id += 1;
spawn_session(
&mut sessions,
next_session_id,
spawned_sessions,
Arc::clone(&model),
license.clone(),
config.clone(),
Expand Down Expand Up @@ -188,7 +186,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

fn spawn_session(
sessions: &mut JoinSet<SessionReport>,
session_id: usize,
previous_session_id: usize,
model: Arc<Model<'static>>,
license: String,
config: ProcessorConfig,
Expand All @@ -197,7 +195,7 @@ fn spawn_session(
stop: Arc<AtomicBool>,
) {
sessions.spawn(run_session(
session_id,
previous_session_id + 1,
model,
license,
config,
Expand Down
Loading