|
Electroneum
|

Go to the source code of this file.
Classes | |
| struct | th_buck |
| struct | timehist |
Macros | |
| #define | NUM_BUCKETS_HIST 40 |
Functions | |
| struct timehist * | timehist_setup (void) |
| void | timehist_delete (struct timehist *hist) |
| void | timehist_clear (struct timehist *hist) |
| void | timehist_insert (struct timehist *hist, struct timeval *tv) |
| double | timehist_quartile (struct timehist *hist, double q) |
| void | timehist_print (struct timehist *hist) |
| void | timehist_log (struct timehist *hist, const char *name) |
| void | timehist_export (struct timehist *hist, long long *array, size_t sz) |
| void | timehist_import (struct timehist *hist, long long *array, size_t sz) |
This file contains functions to make a histogram of time values.
Definition in file timehist.h.
| #define NUM_BUCKETS_HIST 40 |
Number of buckets in a histogram
Definition at line 46 of file timehist.h.
| void timehist_clear | ( | struct timehist * | hist | ) |
Clear histogram
| hist | to clear all data from |
| void timehist_delete | ( | struct timehist * | hist | ) |
Delete histogram
| hist | to delete |
| void timehist_export | ( | struct timehist * | hist, |
| long long * | array, | ||
| size_t | sz | ||
| ) |
Export histogram to an array.
| hist | histogram |
| array | the array to export to. |
| sz | number of items in array. |
| void timehist_import | ( | struct timehist * | hist, |
| long long * | array, | ||
| size_t | sz | ||
| ) |
Import histogram from an array.
| hist | histogram |
| array | the array to import from. |
| sz | number of items in array. |
| void timehist_insert | ( | struct timehist * | hist, |
| struct timeval * | tv | ||
| ) |
Add time value to histogram.
| hist | histogram |
| tv | time value |
| void timehist_log | ( | struct timehist * | hist, |
| const char * | name | ||
| ) |
Log histogram, print it to the logfile.
| hist | histogram |
| name | the name of the value column |
| void timehist_print | ( | struct timehist * | hist | ) |
Printout histogram
| hist | histogram |
| double timehist_quartile | ( | struct timehist * | hist, |
| double | q | ||
| ) |
Find time value for given quartile, such as 0.25, 0.50, 0.75. The looks up the value for the i-th element in the sorted list of time values, as approximated using the histogram.
| hist | histogram. Interpolated information is used from it. |
| q | quartile, 0.50 results in the median. Must be >0 and <1. |
| struct timehist* timehist_setup | ( | void | ) |
Setup a histogram, default