| Asterisk - The Open Source Telephony Project GIT-master-27fb039
    | 
#include "asterisk/optional_api.h"

Go to the source code of this file.
| Macros | |
| #define | AST_STATSD_COUNTER "c" | 
| #define | AST_STATSD_GAUGE "g" | 
| Support for publishing to a statsd server. | |
| #define | AST_STATSD_GUAGE AST_STATSD_GAUGE | 
| #define | AST_STATSD_HISTOGRAM "h" | 
| #define | AST_STATSD_METER "m" | 
| #define | AST_STATSD_TIMER "ms" | 
| Functions | |
| void AST_OPTIONAL_API_NAME() | ast_statsd_log (const char *metric_name, const char *metric_type, intmax_t value) | 
| Send a stat to the configured statsd server. | |
| void AST_OPTIONAL_API_NAME() | ast_statsd_log_full (const char *metric_name, const char *metric_type, intmax_t value, double sample_rate) | 
| Send a stat to the configured statsd server. | |
| void AST_OPTIONAL_API_NAME() | ast_statsd_log_full_va (const char *metric_name, const char *metric_type, intmax_t value, double sample_rate,...) | 
| Send a stat to the configured statsd server. | |
| void AST_OPTIONAL_API_NAME() | ast_statsd_log_sample (const char *metric_name, intmax_t value, double sample_rate) | 
| Send a random sampling of a stat to the configured statsd server. | |
| void AST_OPTIONAL_API_NAME() | ast_statsd_log_string (const char *metric_name, const char *metric_type, const char *value, double sample_rate) | 
| Send a stat to the configured statsd server. | |
| void AST_OPTIONAL_API_NAME() | ast_statsd_log_string_va (const char *metric_name, const char *metric_type, const char *value, double sample_rate,...) | 
| Send a stat to the configured statsd server. | |
| #define AST_STATSD_GAUGE "g" | 
| #define AST_STATSD_GUAGE AST_STATSD_GAUGE | 
Embarrassingly, gauge was misspelled for quite some time.
| #define AST_STATSD_HISTOGRAM "h" | 
| #define AST_STATSD_METER "m" | 
Meters are non-standard and poorly supported by StatsD servers
| void AST_OPTIONAL_API_NAME() ast_statsd_log | ( | const char * | metric_name, | 
| const char * | metric_type, | ||
| intmax_t | value | ||
| ) | 
Send a stat to the configured statsd server.
| metric_name | String (UTF-8) name of the metric. | 
| metric_type | Type of metric to send. | 
| value | Value to send. | 
Definition at line 251 of file res_statsd.c.
References ast_statsd_log_string(), and value.
Referenced by load_module(), statsmaker(), and updates().
| void AST_OPTIONAL_API_NAME() ast_statsd_log_full | ( | const char * | metric_name, | 
| const char * | metric_type, | ||
| intmax_t | value, | ||
| double | sample_rate | ||
| ) | 
Send a stat to the configured statsd server.
The is nearly the most flexible function for sending a message to the statsd server, but also the least easy to use. See ast_statsd_log() or ast_statsd_log_sample() for a slightly more convenient interface.
| metric_name | String (UTF-8) name of the metric. | 
| metric_type | Type of metric to send. | 
| value | Value to send. | 
| sample_rate | Percentage of samples to send. | 
Definition at line 193 of file res_statsd.c.
References ast_statsd_log_string(), and value.
Referenced by ast_statsd_log_full_va().
| void AST_OPTIONAL_API_NAME() ast_statsd_log_full_va | ( | const char * | metric_name, | 
| const char * | metric_type, | ||
| intmax_t | value, | ||
| double | sample_rate, | ||
| ... | |||
| ) | 
Send a stat to the configured statsd server.
This is the most flexible function for sending a message to the statsd server. In addition to allowing the value and sample rate to be specified, the metric_name can be formed as a printf style string with variable arguments.
| metric_name | Format string (UTF-8) specifying the name of the metric. | 
| metric_type | Type of metric to send. | 
| value | Value to send. | 
| sample_rate | Percentage of samples to send. | 
Example Usage:
Definition at line 228 of file res_statsd.c.
References AST_DYNSTR_BUILD_FAILED, ast_statsd_log_full(), ast_str_buffer(), ast_str_set_va(), ast_str_thread_get(), buf, and value.
Referenced by ast_sip_initialize_sorcery_location(), handle_endpoint_update(), and sip_options_contact_status_notify_task().
| void AST_OPTIONAL_API_NAME() ast_statsd_log_sample | ( | const char * | metric_name, | 
| intmax_t | value, | ||
| double | sample_rate | ||
| ) | 
Send a random sampling of a stat to the configured statsd server.
The type of sampled metrics is always AST_STATSD_COUNTER. The given sample_rate should be a percentage between 0.0 and 1.0. If it's <= 0.0, then no samples will be sent. If it's >= 1.0, then all samples will be sent.
| metric_name | String (UTF-8) name of the metric. | 
| value | Value to send. | 
| sample_rate | Percentage of samples to send. | 
Definition at line 260 of file res_statsd.c.
References AST_STATSD_COUNTER, ast_statsd_log_string(), and value.
| void AST_OPTIONAL_API_NAME() ast_statsd_log_string | ( | const char * | metric_name, | 
| const char * | metric_type, | ||
| const char * | value, | ||
| double | sample_rate | ||
| ) | 
Send a stat to the configured statsd server.
This function uses a character argument for value instead of an intmax_t argument. This is designed to be simpler to use for updating a current value rather than resetting it.
| metric_name | String (UTF-8) name of the metric. | 
| metric_type | Type of metric to send. | 
| value | Value to send. | 
| sample_rate | Percentage of samples to send. | 
Definition at line 136 of file res_statsd.c.
References conf_global_options::add_newline, ao2_cleanup, ao2_global_obj_ref, ast_debug, ast_free, ast_random_double, ast_sendto(), AST_STATSD_COUNTER, AST_STATSD_METER, ast_str_append(), ast_str_buffer(), ast_str_create, ast_str_strlen(), ast_strlen_zero(), conf_server(), conf::global, len(), conf_global_options::meter_support, conf_global_options::prefix, socket_fd, and value.
Referenced by ast_statsd_log(), ast_statsd_log_full(), ast_statsd_log_sample(), ast_statsd_log_string_va(), handle_endpoint_update(), sip_outbound_registration_client_state_destroy(), sip_outbound_registration_state_alloc(), statsd_exec(), update_endpoint_state(), and updates().
| void AST_OPTIONAL_API_NAME() ast_statsd_log_string_va | ( | const char * | metric_name, | 
| const char * | metric_type, | ||
| const char * | value, | ||
| double | sample_rate, | ||
| ... | |||
| ) | 
Send a stat to the configured statsd server.
This is the most flexible function for sending a message to the statsd server. In addition to allowing the string value and sample rate to be specified, the metric_name can be formed as a printf style string with variable arguments.
| metric_name | Format string (UTF-8) specifying the name of the metric. | 
| metric_type | Type of metric to send. | 
| value | Value to send. | 
| sample_rate | Percentage of samples to send. | 
Example Usage:
Definition at line 205 of file res_statsd.c.
References AST_DYNSTR_BUILD_FAILED, ast_statsd_log_string(), ast_str_buffer(), ast_str_set_va(), ast_str_thread_get(), buf, and value.
Referenced by ast_res_pjsip_find_or_create_contact_status(), sip_options_contact_status_notify_task(), sip_options_remove_contact_status(), sip_options_set_contact_status(), sip_outbound_registration_client_state_destroy(), sip_outbound_registration_state_alloc(), and update_client_state_status().