mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 10:15:31 +00:00
Move all crates to new crates dir
This commit is contained in:
parent
3835da22ac
commit
9b032f7e24
128 changed files with 27 additions and 26 deletions
30
crates/ws_load_test/src/common.rs
Normal file
30
crates/ws_load_test/src/common.rs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
use std::sync::{atomic::AtomicUsize, Arc};
|
||||
|
||||
use rand_distr::Gamma;
|
||||
|
||||
pub use aquatic_ws_protocol::*;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Statistics {
|
||||
pub requests: AtomicUsize,
|
||||
pub response_peers: AtomicUsize,
|
||||
pub responses_announce: AtomicUsize,
|
||||
pub responses_offer: AtomicUsize,
|
||||
pub responses_answer: AtomicUsize,
|
||||
pub responses_scrape: AtomicUsize,
|
||||
pub responses_error: AtomicUsize,
|
||||
pub connections: AtomicUsize,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct LoadTestState {
|
||||
pub info_hashes: Arc<Vec<InfoHash>>,
|
||||
pub statistics: Arc<Statistics>,
|
||||
pub gamma: Arc<Gamma<f64>>,
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq, Clone, Copy)]
|
||||
pub enum RequestType {
|
||||
Announce,
|
||||
Scrape,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue