Skip to content

Commit

Permalink
Generating load using repeat_fn.
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitkulshreshtha committed Dec 16, 2024
1 parent 87ee9da commit 77f3558
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
8 changes: 8 additions & 0 deletions datastores/gossip_kv/kv/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,14 @@ where
})
-> writes;

simulated_puts = repeat_fn(2000, || {
upsert_row(Clock::new(100), rand::random(), "value".to_string())
})
-> inspect (|_| {
SETS_COUNTER.inc();
})
-> writes;

client_in[Delete]
-> null();
// -> inspect(|req| trace!("{:?}: Received Delete request: {:?}.", context.current_tick(), req))
Expand Down
22 changes: 11 additions & 11 deletions datastores/gossip_kv/load_test_server/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,17 @@ fn run_server(
// });

let local = task::LocalSet::new();
local.spawn_local(async move {
// let key_master: Key = "/usr/table/key".parse().unwrap();
loop {
let request = ClientRequest::Set {
key: 100,
value: "FOOBAR".to_string(),
};
client_input_tx.send((request, UNKNOWN_ADDRESS)).await.unwrap();
SETS_SENT.inc();
}
});
// local.spawn_local(async move {
// // let key_master: Key = "/usr/table/key".parse().unwrap();
// loop {
// let request = ClientRequest::Set {
// key: 100,
// value: "FOOBAR".to_string(),
// };
// client_input_tx.send((request, UNKNOWN_ADDRESS)).await.unwrap();
// SETS_SENT.inc();
// }
// });


// Networking
Expand Down

0 comments on commit 77f3558

Please sign in to comment.