ze-filter  (ze-filter-0.8.0-develop-180218)
ze-throttle.c File Reference
#include <ze-sys.h>
#include "ze-filter.h"

Go to the source code of this file.

Classes

struct  HStat_T
 
struct  ThrottleData
 

Macros

#define LOG_LEVEL   11
 
#define DIM_HI   1024
 
#define DIM_SHFT   6
 
#define DIM_LO   (DIM_HI >> DIM_SHFT)
 
#define DIM_RAP   (DIM_HI / DIM_LO)
 
#define THROTTLE_LOCK()
 
#define THROTTLE_UNLOCK()
 
#define HOLD_TIME   120
 
#define DOS_COEF   5.0
 

Typedefs

typedef struct HStat_T HStat_T
 
typedef struct ThrottleData ThrottleData
 

Functions

void add_throttle_entry (time_t)
 
void update_throttle (time_t)
 
double poisson_upper_bound (double, double)
 
void throttle_free ()
 
int throttle_resize (size_t sza, size_t szb)
 
bool check_throttle_dos ()
 
bool update_throttle_dos ()
 
void log_throttle_stats ()
 

Macro Definition Documentation

◆ DIM_HI

#define DIM_HI   1024

Definition at line 48 of file ze-throttle.c.

◆ DIM_LO

#define DIM_LO   (DIM_HI >> DIM_SHFT)

Definition at line 50 of file ze-throttle.c.

◆ DIM_RAP

#define DIM_RAP   (DIM_HI / DIM_LO)

Definition at line 51 of file ze-throttle.c.

◆ DIM_SHFT

#define DIM_SHFT   6

Definition at line 49 of file ze-throttle.c.

◆ DOS_COEF

#define DOS_COEF   5.0

Definition at line 253 of file ze-throttle.c.

◆ HOLD_TIME

#define HOLD_TIME   120

Definition at line 248 of file ze-throttle.c.

◆ LOG_LEVEL

#define LOG_LEVEL   11

Definition at line 33 of file ze-throttle.c.

◆ THROTTLE_LOCK

#define THROTTLE_LOCK ( )
Value:
if (pthread_mutex_lock(&hdata.mutex) != 0) { \
ZE_LogSysError("pthread_mutex_lock"); \
}
pthread_mutex_t mutex
Definition: ze-throttle.c:57

Definition at line 67 of file ze-throttle.c.

◆ THROTTLE_UNLOCK

#define THROTTLE_UNLOCK ( )
Value:
if (pthread_mutex_unlock(&hdata.mutex) != 0) { \
ZE_LogSysError("pthread_mutex_unlock"); \
}
pthread_mutex_t mutex
Definition: ze-throttle.c:57

Definition at line 72 of file ze-throttle.c.

Typedef Documentation

◆ HStat_T

typedef struct HStat_T HStat_T

◆ ThrottleData

typedef struct ThrottleData ThrottleData

Definition at line 63 of file ze-throttle.c.

Function Documentation

◆ add_throttle_entry()

void add_throttle_entry ( time_t  t)

Definition at line 148 of file ze-throttle.c.

◆ check_throttle_dos()

bool check_throttle_dos ( void  )

Definition at line 239 of file ze-throttle.c.

◆ log_throttle_stats()

void log_throttle_stats ( void  )

Definition at line 313 of file ze-throttle.c.

◆ poisson_upper_bound()

double poisson_upper_bound ( double  lambda,
double  prob 
)

Definition at line 330 of file ze-throttle.c.

◆ throttle_free()

void throttle_free ( )

Definition at line 119 of file ze-throttle.c.

◆ throttle_resize()

int throttle_resize ( size_t  sza,
size_t  szb 
)

Definition at line 132 of file ze-throttle.c.

◆ update_throttle()

void update_throttle ( time_t  t)

Definition at line 186 of file ze-throttle.c.

◆ update_throttle_dos()

bool update_throttle_dos ( )

Definition at line 256 of file ze-throttle.c.