Tor 0.4.9.8
Loading...
Searching...
No Matches
metrics_store_entry.h File Reference

Header for lib/metrics/metrics_store_entry.c. More...

Go to the source code of this file.

Macros

#define metrics_store_entry_free(entry)
 

Typedefs

typedef struct metrics_store_entry_t metrics_store_entry_t
 

Functions

metrics_store_entry_t * metrics_store_entry_new (const metrics_type_t type, const char *name, const char *help, size_t bucket_count, const int64_t *buckets)
 
void metrics_store_entry_free_ (metrics_store_entry_t *entry)
 
int64_t metrics_store_entry_get_value (const metrics_store_entry_t *entry)
 
uint64_t metrics_store_hist_entry_get_value (const metrics_store_entry_t *entry, const int64_t bucket)
 
bool metrics_store_entry_has_label (const metrics_store_entry_t *entry, const char *label)
 
metrics_store_entry_t * metrics_store_find_entry_with_label (const smartlist_t *entries, const char *label)
 
bool metrics_store_entry_is_histogram (const metrics_store_entry_t *entry)
 
uint64_t metrics_store_hist_entry_get_count (const metrics_store_entry_t *entry)
 
int64_t metrics_store_hist_entry_get_sum (const metrics_store_entry_t *entry)
 
void metrics_store_entry_add_label (metrics_store_entry_t *entry, const char *label)
 
void metrics_store_entry_reset (metrics_store_entry_t *entry)
 
void metrics_store_entry_update (metrics_store_entry_t *entry, const int64_t value)
 
void metrics_store_hist_entry_update (metrics_store_entry_t *entry, const int64_t value, const int64_t obs)
 

Detailed Description

Macro Definition Documentation

◆ metrics_store_entry_free

#define metrics_store_entry_free ( entry)
Value:
FREE_AND_NULL(metrics_store_entry_t, metrics_store_entry_free_, (entry));
void metrics_store_entry_free_(metrics_store_entry_t *entry)

Definition at line 57 of file metrics_store_entry.h.

Typedef Documentation

◆ metrics_store_entry_t

typedef struct metrics_store_entry_t metrics_store_entry_t

Definition at line 47 of file metrics_store_entry.h.

Function Documentation

◆ metrics_store_entry_add_label()

◆ metrics_store_entry_free_()

void metrics_store_entry_free_ ( metrics_store_entry_t * entry)

Free a store entry.

Definition at line 60 of file metrics_store_entry.c.

◆ metrics_store_entry_get_value()

int64_t metrics_store_entry_get_value ( const metrics_store_entry_t * entry)

Return store entry value.

Definition at line 165 of file metrics_store_entry.c.

Referenced by prometheus_format_store_entry().

◆ metrics_store_entry_has_label()

bool metrics_store_entry_has_label ( const metrics_store_entry_t * entry,
const char * label )

Return true iff the given entry has the given label.

Definition at line 234 of file metrics_store_entry.c.

Referenced by hs_metrics_update_by_service().

◆ metrics_store_entry_is_histogram()

bool metrics_store_entry_is_histogram ( const metrics_store_entry_t * entry)

Return true iff the specified entry is a histogram.

Definition at line 265 of file metrics_store_entry.c.

Referenced by hs_metrics_update_by_service().

◆ metrics_store_entry_new()

metrics_store_entry_t * metrics_store_entry_new ( const metrics_type_t type,
const char * name,
const char * help,
size_t bucket_count,
const int64_t * buckets )

Return newly allocated store entry of the specified type.

Definition at line 28 of file metrics_store_entry.c.

Referenced by metrics_store_add().

◆ metrics_store_entry_reset()

void metrics_store_entry_reset ( metrics_store_entry_t * entry)

Reset a store entry that is set its metric data to 0.

Definition at line 142 of file metrics_store_entry.c.

Referenced by hs_metrics_update_by_service(), and metrics_store_hist_entry_update().

◆ metrics_store_entry_update()

◆ metrics_store_find_entry_with_label()

metrics_store_entry_t * metrics_store_find_entry_with_label ( const smartlist_t * entries,
const char * label )

Return the first entry that has the given label, or NULL if none of the entries have the label.

Definition at line 246 of file metrics_store_entry.c.

◆ metrics_store_hist_entry_get_count()

uint64_t metrics_store_hist_entry_get_count ( const metrics_store_entry_t * entry)

Return the total number of observations for the specified histogram.

Definition at line 276 of file metrics_store_entry.c.

Referenced by format_histogram().

◆ metrics_store_hist_entry_get_sum()

int64_t metrics_store_hist_entry_get_sum ( const metrics_store_entry_t * entry)

Return the sum of all observations for the specified histogram.

Definition at line 289 of file metrics_store_entry.c.

Referenced by format_histogram().

◆ metrics_store_hist_entry_get_value()

uint64_t metrics_store_hist_entry_get_value ( const metrics_store_entry_t * entry,
const int64_t bucket )

Return store entry value for the specified bucket.

Note: entry must be a histogram.

Definition at line 196 of file metrics_store_entry.c.

◆ metrics_store_hist_entry_update()

void metrics_store_hist_entry_update ( metrics_store_entry_t * entry,
const int64_t value,
const int64_t obs )

Update a store entry with value for the specified observation obs.

Note: entry must be a histogram.

Definition at line 109 of file metrics_store_entry.c.

Referenced by hs_metrics_update_by_service().