nemea-common 1.6.3
|
Delaying sending of records according to their original timestamps. More...
#include <sys/time.h>
Go to the source code of this file.
Data Structures | |
struct | rt_state_s |
State of real-time delaying (for real-time sending). More... | |
Macros | |
#define | RT_PAR_SET_DEFAULT 0 |
#define | DEFAULT_POOL_SIZE 10 |
#define | DEFAULT_INIT_TS_CNT 1000 |
#define | DEFAULT_SAMPLE_RATE 100 |
#define | DEFAULT_TS_DIFF_THRESHOLD 3.5 |
#define | RT_INIT(rt_state, pool_size, init_timestamp_count, par_sample_rate, timestamp_diff_threshold, err_command) |
Initialization of real-time delaying (sending) state. If some initialization value is equal to RT_PAR_SET_DEFAULT, according parameter is then set to default value. First and last parameter is mandatory. | |
#define | RT_DESTROY(rt_state) free(rt_state.mins); |
Just frees allocated memory. | |
#define | RT_CHECK_DELAY(record_counter, actual_timestamp, rt_state) |
Main delaying functionality At first it determines initial timestamp from n first flows. Then it checks after each sample if one second of data was send. If it was, then real-time is checked and sending is corrected by sleep (or not to sleep). | |
Typedefs | |
typedef struct rt_state_s | rt_state_t |
State of real-time delaying (for real-time sending). | |
Delaying sending of records according to their original timestamps.
Definition in file real_time_sending.h.
#define DEFAULT_INIT_TS_CNT 1000 |
Definition at line 51 of file real_time_sending.h.
#define DEFAULT_POOL_SIZE 10 |
Definition at line 50 of file real_time_sending.h.
#define DEFAULT_SAMPLE_RATE 100 |
Definition at line 52 of file real_time_sending.h.
#define DEFAULT_TS_DIFF_THRESHOLD 3.5 |
Definition at line 53 of file real_time_sending.h.
#define RT_CHECK_DELAY | ( | record_counter, | |
actual_timestamp, | |||
rt_state | |||
) |
Main delaying functionality At first it determines initial timestamp from n first flows. Then it checks after each sample if one second of data was send. If it was, then real-time is checked and sending is corrected by sleep (or not to sleep).
[in] | record_counter | Count of actually send records. |
[in] | actual_timestamp | Timestamp of actual record. |
[in] | Name | of identifier, which holds real-time delaying state structure. |
Definition at line 130 of file real_time_sending.h.
#define RT_DESTROY | ( | rt_state | ) | free(rt_state.mins); |
Just frees allocated memory.
Definition at line 119 of file real_time_sending.h.
#define RT_INIT | ( | rt_state, | |
pool_size, | |||
init_timestamp_count, | |||
par_sample_rate, | |||
timestamp_diff_threshold, | |||
err_command | |||
) |
Initialization of real-time delaying (sending) state. If some initialization value is equal to RT_PAR_SET_DEFAULT, according parameter is then set to default value. First and last parameter is mandatory.
[in] | rt_state | Name of identifier, which holds real-time delaying state structure. |
[in] | pool_size | Size of pool for minimal timestamps to compute average minimal timestamp. |
[in] | init_timestamp_count | From how many first flows should be minimal timestamp determined. |
[in] | par_sample_rate | Sets initial sample rate - says how offten should be timestamp difference checked. |
[in] | timestamp_diff_threshold | "magic" value which represents change in timestamps of records in real traffic. |
[in] | err_command | Command, which should be executed if malloc fails. |
Definition at line 85 of file real_time_sending.h.
#define RT_PAR_SET_DEFAULT 0 |
Definition at line 48 of file real_time_sending.h.
typedef struct rt_state_s rt_state_t |
State of real-time delaying (for real-time sending).