csle_collector.client_manager.threads package

Submodules

csle_collector.client_manager.threads.arrival_thread module

class csle_collector.client_manager.threads.arrival_thread.ArrivalThread(time_step_len_seconds: float, clients: List[csle_collector.client_manager.dao.client.Client], workflows_config: csle_collector.client_manager.dao.workflows_config.WorkflowsConfig)[source]

Bases: threading.Thread

Thread that generates client arrivals (starts client threads according to a Poisson process)

static constant_poisson_rate(arrival_config: csle_collector.client_manager.dao.constant_arrival_config.ConstantArrivalConfig) float[source]

Function that returns the rate of a stationary Poisson process

Parameters

arrival_config – the arrival process configuration

Returns

the rate

static eptmp_rate(t: int, arrival_config: csle_collector.client_manager.dao.eptmp_arrival_config.EPTMPArrivalConfig) float[source]

Function that returns the rate of a EPTMP Poisson process.

EPTMP or Exponential-Polynomial-Trigonometric rate function having Multiple Periodicities. This class is used for creating a rate function that can exhibit both global trends as well as periodic components with individual frequencies and amplitudes. (Kuhl and Wilson, 1995)

Parameters
  • t – the time-step

  • arrival_config – the arrival process configuration

Returns

the rate

static piece_wise_constant_rate(t: int, arrival_config: csle_collector.client_manager.dao.piece_wise_constant_arrival_config.PieceWiseConstantArrivalConfig) float[source]

Function that returns the rate of a piece-wise constant Poisson process

Parameters
  • t – the time-step

  • arrival_config – the arrival process configuration

Returns

the rate

run() None[source]

Runs the arrival generator, generates new clients dynamically according to a Poisson process

Returns

None

static sine_modulated_poisson_rate(t: int, arrival_config: csle_collector.client_manager.dao.sine_arrival_config.SineArrivalConfig) float[source]

Function that returns the rate of a sine-modulated Poisson process

Parameters
  • t – the time-step

  • arrival_config – the arrival process configuration

Returns

the rate

static spiking_poisson_arrival_rate(t: int, arrival_config: csle_collector.client_manager.dao.spiking_arrival_config.SpikingArrivalConfig) float[source]

Function that returns the rate of a spiking Poisson process

Parameters
  • t – the time-step

  • arrival_config – the arrival process configuration

Returns

the rate

csle_collector.client_manager.threads.client_thread module

class csle_collector.client_manager.threads.client_thread.ClientThread(commands: List[str], time_step_len_seconds: float)[source]

Bases: threading.Thread

Thread representing a client

run() None[source]

The main function of the client. It executes a sequence of commands and then terminates

Returns

None

csle_collector.client_manager.threads.producer_thread module

class csle_collector.client_manager.threads.producer_thread.ProducerThread(arrival_thread: csle_collector.client_manager.threads.arrival_thread.ArrivalThread, time_step_len_seconds: int, ip: str, port: int)[source]

Bases: threading.Thread

Thread that pushes statistics to Kafka

run() None[source]

Main loop of the thread, pushes data to Kafka periodically

Returns

None

Module contents