struct sa_p2_histogram sa_p2_histogram
double sa_add_p2_quantile(sa_p2_quantile *p2q, double x)
Updates the quantile with the provided observation.
double sa_estimate_p2_histogram(sa_p2_histogram *p2h, unsigned short marker)
Gets the estimated quantile value for the specified marker.
unsigned long long sa_count_p2_histogram(sa_p2_histogram *p2h, unsigned short marker)
Gets the number of observations that are less than or equal to the marker.
int sa_deserialize_p2_quantile(sa_p2_quantile *p2q, const char *buf, size_t len)
Restores the internal state from the serialized output.
void sa_init_p2_quantile(sa_p2_quantile *p2q)
Zeros out the quantile.
unsigned long long sa_count_p2_quantile(sa_p2_quantile *p2q, unsigned short marker)
Returns the number of observations that are less than or equal to the marker.
void sa_add_p2_histogram(sa_p2_histogram *p2h, double x)
Updates the histogram with the provided observation.
void sa_init_p2_histogram(sa_p2_histogram *p2h)
Zeros out the histogram counters.
char * sa_serialize_p2_quantile(sa_p2_quantile *p2q, size_t *len)
Serialize the internal state to a buffer.
sa_p2_quantile * sa_create_p2_quantile(double p)
Allocates and initializes the data structure.
char * sa_serialize_p2_histogram(sa_p2_histogram *p2h, size_t *len)
Serialize the internal state to a buffer.
int sa_deserialize_p2_histogram(sa_p2_histogram *p2h, const char *buf, size_t len)
Restores the internal state from the serialized output.
void sa_destroy_p2_quantile(sa_p2_quantile *p2q)
Free the associated memory.
void sa_destroy_p2_histogram(sa_p2_histogram *p2h)
Free the associated memory.
double sa_estimate_p2_quantile(sa_p2_quantile *p2q, unsigned short marker)
Returns the estimated quantile value for the specified marker.
struct sa_p2_quantile sa_p2_quantile
sa_p2_histogram * sa_create_p2_histogram(unsigned short buckets)
Allocates and initializes the data structures.