Collecting statistics within the runtime. More...
Go to the source code of this file.
Functions | |
| int | remove_stat_item (enum stat_id stat_id, unsigned int item_id) |
| Un-registers an item so it can no longer have statistics registered, and will not be reported to the global controller. More... | |
| int | init_stat_item (enum stat_id stat_id, unsigned int item_id) |
| Initializes a new stat item so it can have stats registered and can be reported to the global controller. More... | |
| int | init_statistics () |
| Initializes the entire stats module. More... | |
| void | finalize_statistics (char *statlog) |
| Writes the statistics to statlog if provided, and frees assocated structure. More... | |
| int | record_start_time (enum stat_id stat_id, unsigned int item_id) |
| Starts a measurement of elapsed time. More... | |
| int | record_end_time (enum stat_id stat_id, unsigned int item_id) |
| Records the elapsed time since the previous call to record_start_time. More... | |
| int | increment_stat (enum stat_id stat_id, unsigned int item_id, double value) |
| Increments the given statistic by the provided value. More... | |
| int | record_stat (enum stat_id stat_id, unsigned int item_id, double stat, bool relog) |
| Records a statistic in the statlog. More... | |
| double | get_last_stat (enum stat_id stat_id, unsigned int item_id) |
| Returns the last statistic recorded. More... | |
| struct stat_sample * | get_stat_samples (enum stat_id stat_id, struct timespec *time, int *n_sample_out) |
| Samples the statistic with the provided stat_id. More... | |
Collecting statistics within the runtime.
Definition in file rt_stats.h.
| void finalize_statistics | ( | char * | statlog | ) |
Writes the statistics to statlog if provided, and frees assocated structure.
| statlog | Log file to dump statistics to or NULL if N/A |
Definition at line 822 of file rt_stats.c.
| double get_last_stat | ( | enum stat_id | stat_id, |
| unsigned int | item_id | ||
| ) |
Returns the last statistic recorded.
Definition at line 466 of file rt_stats.c.
| struct stat_sample* get_stat_samples | ( | enum stat_id | stat_id, |
| struct timespec * | time, | ||
| int * | n_sample_out | ||
| ) |
Samples the statistic with the provided stat_id.
| stat_id | the ID of the stat_type to sample |
| time | The time at which the samples should be taken |
| n_samples_out | Output argument, stores the number of samples acquired |
Definition at line 634 of file rt_stats.c.
| int increment_stat | ( | enum stat_id | stat_id, |
| unsigned int | item_id, | ||
| double | value | ||
| ) |
Increments the given statistic by the provided value.
| stat_id | ID for the stat being logged |
| item_id | ID for the item to which the stat refers (must be registered!) |
| value | The amount to add to the given stat |
Definition at line 389 of file rt_stats.c.
Initializes a new stat item so it can have stats registered and can be reported to the global controller.
Initializes a new stat item so it can have stats registered and can be reported to the global controller.
(e.g. initializing MSU_QUEUE_LEN for item N, corresponding to msu # N)
| stat_id | ID of the statistic type to be logged |
| item_id | ID of the item to be logged |
Definition at line 719 of file rt_stats.c.
| int init_statistics | ( | ) |
Initializes the entire stats module.
MUST BE CALLED before runtime starts
Definition at line 783 of file rt_stats.c.
| int record_end_time | ( | enum stat_id | stat_id, |
| unsigned int | item_id | ||
| ) |
Records the elapsed time since the previous call to record_start_time.
| stat_id | ID for stat being logged |
| item_id | ID for item within the statistic |
Definition at line 355 of file rt_stats.c.
| int record_start_time | ( | enum stat_id | stat_id, |
| unsigned int | item_id | ||
| ) |
Starts a measurement of elapsed time.
Not added to the log until a call to record_end_time
| stat_id | ID for stat type being logged |
| item_id | ID for the item to which the stat refers |
Definition at line 320 of file rt_stats.c.
| int record_stat | ( | enum stat_id | stat_id, |
| unsigned int | item_id, | ||
| double | stat, | ||
| bool | relog | ||
| ) |
Records a statistic in the statlog.
| stat_id | ID for stat being logged |
| item_id | ID for item to which stat refers (must be registered!) |
| stat | Statistic to record |
| relog | Whether to log statistic if it matches the previously logged stat |
Definition at line 426 of file rt_stats.c.
| int remove_stat_item | ( | enum stat_id | stat_id, |
| unsigned int | item_id | ||
| ) |
Un-registers an item so it can no longer have statistics registered, and will not be reported to the global controller.
Definition at line 683 of file rt_stats.c.
1.8.6