Skip to content

Conversation

@philipglazman
Copy link
Contributor

No description provided.


pub async fn run(&self) {
// number of concurrent websocket connections
let num_connections: usize = 4;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add this as a configurable struct field or run fn arg?

for _ in 0..num_connections {
let ws_url = self.ws_url.clone();
let http_client = self.rpc_client.clone();
tasks.push(tokio::spawn(async move {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please split this into a separate fn (and sub-fns since this block is quite long.

for _ in 0..num_connections {
let ws_url = self.ws_url.clone();
let http_client = self.rpc_client.clone();
tasks.push(tokio::spawn(async move {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tasks need to be cancellable. See other workers for examples

.into_iter())
let mut tasks = Vec::new();

if traffic_gen.spam_rpc {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, but this feels like it would be better as a WorkloadGroup level arg instead of TrafficGen. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants