pub fn new(
        task_sets_index: usize,
        base_url: Url,
        min_wait: usize,
        max_wait: usize,
        configuration: &SwanlingConfiguration,
        load_test_hash: u64,
    ) -> Result<Self, SwanlingError> {
        trace!("new SwanlingUser");
        let client = Client::builder()
            .user_agent(APP_USER_AGENT)
            .cookie_store(true)
            .build()?;

        Ok(SwanlingUser {
            started: Instant::now(),
            task_sets_index,
            client: Arc::new(Mutex::new(client)),
            position: Arc::new(AtomicUsize::new(0)),
            base_url: Arc::new(RwLock::new(base_url)),
            min_wait,
            max_wait,
            config: configuration.clone(),
            logger: None,
            throttle: None,
            is_throttled: true,
            channel_to_parent: None,
            // A value of max_value() indicates this user isn't fully initialized yet.
            weighted_users_index: usize::max_value(),
            weighted_on_start_tasks: Vec::new(),
            weighted_tasks: Vec::new(),
            weighted_on_stop_tasks: Vec::new(),
            load_test_hash,
            request_cadence: Arc::new(RwLock::new(SwanlingRequestCadence::new())),
            slept: Arc::new(AtomicU64::new(0)),
        })
    }
/// Create a new user state.
Create a new user state.
Create a new user state .
pub fn new(
        task_sets_index: usize,
        base_url: Url,
        min_wait: usize,
        max_wait: usize,
        configuration: &SwanlingConfiguration,
        load_test_hash: u64,
    ) -> Result<Self, SwanlingError> {
        trace!("new SwanlingUser");
        let client = Client::builder()
            .user_agent(APP_USER_AGENT)
            .cookie_store(true)
            .build()?;
        Ok(SwanlingUser {
            started: Instant::now(),
            task_sets_index,
            client: Arc::new(Mutex::new(client)),
            position: Arc::new(AtomicUsize::new(0)),
            base_url: Arc::new(RwLock::new(base_url)),
            min_wait,
            max_wait,
            config: configuration.clone(),
            logger: None,
            throttle: None,
            is_throttled: true,
            channel_to_parent: None,
            // A value of max_value() indicates this user isn't fully initialized yet.
            weighted_users_index: usize::max_value(),
            weighted_on_start_tasks: Vec::new(),
            weighted_tasks: Vec::new(),
            weighted_on_stop_tasks: Vec::new(),
            load_test_hash,
            request_cadence: Arc::new(RwLock::new(SwanlingRequestCadence::new())),
            slept: Arc::new(AtomicU64::new(0)),
        })
    }
pub fn new ( task_sets_index : usize , base_url : Url , min_wait : usize , max_wait : usize , configuration : & SwanlingConfiguration , load_test_hash : u64 , ) -> Result < Self , SwanlingError > { trace ! ( " " ) ; let client = Client :: builder ( ) . user_agent ( APP_USER_AGENT ) . cookie_store ( true ) . build ( ) ? ; Ok ( SwanlingUser { started : Instant :: now ( ) , task_sets_index , client : Arc :: new ( Mutex :: new ( client ) ) , position : Arc :: new ( AtomicUsize :: new ( 0 ) ) , base_url : Arc :: new ( RwLock :: new ( base_url ) ) , min_wait , max_wait , config : configuration . clone ( ) , logger : None , throttle : None , is_throttled : true , channel_to_parent : None , // A value of max_value() indicates this user isn't fully initialized yet. weighted_users_index : usize :: max_value ( ) , weighted_on_start_tasks : Vec :: new ( ) , weighted_tasks : Vec :: new ( ) , weighted_on_stop_tasks : Vec :: new ( ) , load_test_hash , request_cadence : Arc :: new ( RwLock :: new ( SwanlingRequestCadence :: new ( ) ) ) , slept : Arc :: new ( AtomicU64 :: new ( 0 ) ) , } ) }
Create a new user state.
Create a new user state .
task_sets_index
usize
base_url
Url
min_wait
usize
max_wait
usize
configuration
&SwanlingConfiguration
load_test_hash
u64