Functions for the sending and receiving of statistics between ctrl and runtime. More...
Go to the source code of this file.
Classes | |
| struct | timed_stat |
| Holds a single timestamped value. More... | |
| struct | stat_sample_hdr |
| Header for a single stat sample for a single item. More... | |
| struct | stat_sample |
| A single stat sample for a single item. More... | |
| struct | stat_type_label |
| Structure to hold both the stat ID and the string describing it. More... | |
Macros | |
| #define | REPORTED_MSU_STAT_TYPES |
| #define | REPORTED_THREAD_STAT_TYPES |
| #define | REPORTED_STAT_TYPES |
| #define | N_REPORTED_STAT_TYPES sizeof(reported_stat_types) / sizeof(*reported_stat_types) |
| Number of reported stat types. More... | |
| #define | N_REPORTED_MSU_STAT_TYPES sizeof(reported_msu_stat_types) / sizeof(*reported_msu_stat_types) |
| #define | N_REPORTED_THREAD_STAT_TYPES sizeof(reported_thread_stat_types) / sizeof(*reported_thread_stat_types) |
| #define | MAX_STAT_ITEM_ID 4192 |
| Maxmimum identifier that can be assigned to a stat item. More... | |
| #define | STAT_SAMPLE_SIZE 5 |
| Number of statistics sampled in each send from runtime to controller. More... | |
| #define | STAT_SAMPLE_PERIOD_MS 500 |
| How often samples are sent from runtime to controller. More... | |
Functions | |
| int | is_thread_stat (enum stat_id id) |
| int | is_msu_stat (enum stat_id id) |
| void | free_stat_samples (struct stat_sample *samples, int n_samples) |
| Frees a set of stat samples. More... | |
| struct stat_sample * | init_stat_samples (int max_stats, int n_samples) |
Initilizes n sets of samples of statistics, each of which contains max_stats points. More... | |
| int | deserialize_stat_samples (void *buffer, size_t buff_len, struct stat_sample *samples, int n_samples) |
Deserializes from the provided buffer into the samples structure. More... | |
| ssize_t | serialize_stat_samples (struct stat_sample *samples, int n_samples, void *buffer, size_t buff_len) |
Serializes from the provided samples into the buffer More... | |
| size_t | serialized_stat_sample_size (struct stat_sample *sample, int n_samples) |
Determines the size needed to hold the serialized version of sample. More... | |
Variables | |
| static struct stat_type_label | reported_stat_types [] |
| Static structure so the reported stat types can be referenced as an array. More... | |
| static struct stat_type_label | reported_msu_stat_types [] |
| static struct stat_type_label | reported_thread_stat_types [] |
Functions for the sending and receiving of statistics between ctrl and runtime.
Definition in file stats.h.
| #define MAX_STAT_ITEM_ID 4192 |
| #define N_REPORTED_MSU_STAT_TYPES sizeof(reported_msu_stat_types) / sizeof(*reported_msu_stat_types) |
| #define N_REPORTED_STAT_TYPES sizeof(reported_stat_types) / sizeof(*reported_stat_types) |
| #define N_REPORTED_THREAD_STAT_TYPES sizeof(reported_thread_stat_types) / sizeof(*reported_thread_stat_types) |
| #define REPORTED_MSU_STAT_TYPES |
| #define REPORTED_STAT_TYPES |
| #define REPORTED_THREAD_STAT_TYPES |
| #define STAT_SAMPLE_PERIOD_MS 500 |
| #define STAT_SAMPLE_SIZE 5 |
| int deserialize_stat_samples | ( | void * | buffer, |
| size_t | buff_len, | ||
| struct stat_sample * | samples, | ||
| int | n_samples | ||
| ) |
Deserializes from the provided buffer into the samples structure.
| buffer | The buffer to deserialize |
| buff_len | The size of the serialized buffer |
| samples | The structure into which to deserialize |
| n_samples | The number of items allocated in samples |
| void free_stat_samples | ( | struct stat_sample * | samples, |
| int | n_samples | ||
| ) |
| struct stat_sample* init_stat_samples | ( | int | max_stats, |
| int | n_samples | ||
| ) |
| ssize_t serialize_stat_samples | ( | struct stat_sample * | samples, |
| int | n_samples, | ||
| void * | buffer, | ||
| size_t | buff_len | ||
| ) |
Serializes from the provided samples into the buffer
| samples | The samples to deserialize |
| n_samples | size of samples |
| buffer | The buffer into which to serialize |
| buff_len | The size of the allocated buffer |
| size_t serialized_stat_sample_size | ( | struct stat_sample * | sample, |
| int | n_samples | ||
| ) |
|
static |
|
static |
Static structure so the reported stat types can be referenced as an array.
|
static |
1.8.6