src/utils_latency.[ch]: Improve accuracy, update unit test.
[collectd.git] / src / utils_latency.h
index bb456f5..add7184 100644 (file)
 
 #include "utils_time.h"
 
+#ifndef HISTOGRAM_NUM_BINS
+# define HISTOGRAM_NUM_BINS 1000
+#endif
+
 struct latency_counter_s;
 typedef struct latency_counter_s latency_counter_t;
 
@@ -45,6 +49,17 @@ cdtime_t latency_counter_get_average (latency_counter_t *lc);
 cdtime_t latency_counter_get_percentile (latency_counter_t *lc,
     double percent);
 cdtime_t latency_counter_get_start_time (const latency_counter_t *lc);
+
+/*
+ * NAME
+ *  latency_counter_get_rate(counter,lower,upper,now)
+ *
+ * DESCRIPTION
+ *   Calculates rate of latency values fall within requested interval.
+ *   Interval specified as [lower,upper], i.e. boundaries are inclusive.
+ *   When lower is zero, then the interval is (0, upper].
+ *   When upper is zero, then the interval is [lower, infinity).
+ */
 double latency_counter_get_rate (const latency_counter_t *lc,
     cdtime_t lower, cdtime_t upper, const cdtime_t now);