-
Notifications
You must be signed in to change notification settings - Fork 286
Add websocket and rpc request gen to txgen #2394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
77c5128 to
82bf488
Compare
82bf488 to
aad4a00
Compare
|
|
||
| pub async fn run(&self) { | ||
| // number of concurrent websocket connections | ||
| let num_connections: usize = 4; |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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?
No description provided.