The declarations in this header file correspond to the definitions in t_digest.c.
More...
#include <stdbool.h>
#include "configuration.h"
#include "cdi_logger_api.h"
Go to the source code of this file.
|
#define | MAX_MERGED_CLUSTERS (200) |
| The maximum number of clusters allowed in a fully-merged digest.
|
|
#define | MAX_UNMERGED_CLUSTERS (50) |
| The maximum number of clusters allowed in the incoming sample buffer (i.e unmerged clusters).
|
|
#define | MAX_CLUSTERS (MAX_MERGED_CLUSTERS + MAX_UNMERGED_CLUSTERS) |
| The maximum number of clusters allowed in this algorithm. This determines how many cluster structrues are preallocated when the digest is created.
|
|
#define | TDIGEST_LOG_THREAD(log_level, ...) |
| Macro to allow t-Digest logging to be turned on or off via define DEBUG_T_DIGEST_LOGGING.
|
|
|
typedef struct TDigest * | TDigestHandle |
| Opaque pointer for TDigest structure.
|
|
The declarations in this header file correspond to the definitions in t_digest.c.
◆ TDigestAddSample()
void TDigestAddSample |
( |
TDigestHandle | td_handle, |
|
|
uint32_t | value ) |
Function used to create a new t-digest.
- Parameters
-
td_handle | Handle for the TDigest object to use. |
value | The value of the new sample to add to the digest. |
◆ TDigestClear()
Function used to reset t-digest to begin collecting a new set of statistics. This function initializes all the TDigest data members.
- Parameters
-
td_handle | Handle for the TDigest object to use. |
◆ TDigestCreate()
Function used to create a new t-digest.
- Parameters
-
ret_td_handle_ptr | Pointer for the handle for the new TDigest object. |
- Returns
- True if successful; false if not.
◆ TDigestDestroy()
Function used to free t-digest memory.
- Parameters
-
td_handle | Handle for the TDigest object to use. |
◆ TDigestGetCount()
Function used to get the number of samples in the digest.
- Parameters
-
td_handle | Handle for the TDigest object to use. |
- Returns
- The number of samples in the digest.
◆ TDigestGetPercentileValue()
bool TDigestGetPercentileValue |
( |
TDigestHandle | td_handle, |
|
|
int | percentile, |
|
|
uint32_t * | value_at_percentile_ptr ) |
Function used to get the value at a given percentile.
- Parameters
-
td_handle | Handle for the TDigest object to use. |
percentile | The desired percentile between 0 and 1, inclusive. |
value_at_percentile_ptr | Pointer to the return value where resulting value of percentile search is stored. |
- Returns
- True if successful; false if not.