mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-03 19:16:46 +00:00
Merge "Fixed some typos" into 13
This commit is contained in:
10
CHANGES
10
CHANGES
@@ -44,9 +44,9 @@ res_pjsip_outbound_registration
|
||||
* If res_statsd is loaded and a StatsD server is configured, basic statistics
|
||||
regarding the state of outbound registrations will now be emitted. This
|
||||
includes:
|
||||
- A GUAGE statistic for the overall number of outbound registrations, i.e.:
|
||||
- A GAUGE statistic for the overall number of outbound registrations, i.e.:
|
||||
PJSIP.registrations.count
|
||||
- A GUAGE statistic for the overall number of outbound registrations in a
|
||||
- A GAUGE statistic for the overall number of outbound registrations in a
|
||||
particular state, e.g.:
|
||||
PJSIP.registrations.state.Registered
|
||||
|
||||
@@ -57,7 +57,7 @@ res_pjsip
|
||||
|
||||
* If res_statsd is loaded and a StatsD server is configured, basic statistics
|
||||
regarding the state of PJSIP contacts will not be emitted. This includes:
|
||||
- A GUAGE statistic for the overall number of contacts in a particular
|
||||
- A GAUGE statistic for the overall number of contacts in a particular
|
||||
state, e.g.:
|
||||
PJSIP.contacts.states.Reachable
|
||||
- A TIMER statistic for the RTT time for each qualified contact, e.g.:
|
||||
@@ -77,9 +77,9 @@ res_endpoint_stats
|
||||
-------------------
|
||||
* A new module that emits StatsD statistics regarding Asterisk endpoints.
|
||||
This includes a total count of the number of endpoints, the count of the
|
||||
number of endpoints in the technology agnosti state of the endpoint -
|
||||
number of endpoints in the technology agnostic state of the endpoint -
|
||||
online or offline - as well as the number of channels associated with each
|
||||
endpoint. These are recorded as three differeng GUAGE statistics:
|
||||
endpoint. These are recorded as three different GAUGE statistics:
|
||||
- endpoints.count
|
||||
- endpoints.state.{unknown|offline|online}
|
||||
- endpoints.{tech}.{resource}.channels
|
||||
|
@@ -29,7 +29,12 @@
|
||||
#include "asterisk/optional_api.h"
|
||||
|
||||
/*! An instantaneous measurement of a value. */
|
||||
#define AST_STATSD_GUAGE "g"
|
||||
#define AST_STATSD_GAUGE "g"
|
||||
/*!
|
||||
* Embarrassingly, gauge was misspelled for quite some time.
|
||||
* \deprecated You should spell gauge correctly.
|
||||
*/
|
||||
#define AST_STATSD_GUAGE AST_STATSD_GAUGE
|
||||
/*! A change in a value. */
|
||||
#define AST_STATSD_COUNTER "c"
|
||||
/*! Measure of milliseconds. */
|
||||
@@ -71,7 +76,7 @@ AST_OPTIONAL_API(void, ast_statsd_log_string, (const char *metric_name,
|
||||
*
|
||||
* Example Usage:
|
||||
* \code
|
||||
* ast_statsd_log_string_va(AST_STATSD_GUAGE, "+1", 1.0, "endpoints.states.%s", state_name);
|
||||
* ast_statsd_log_string_va(AST_STATSD_GAUGE, "+1", 1.0, "endpoints.states.%s", state_name);
|
||||
* \endcode
|
||||
*/
|
||||
AST_OPTIONAL_API_ATTR(void, format(printf, 1, 5), ast_statsd_log_string_va,
|
||||
|
@@ -48,13 +48,13 @@ static void update_endpoint_state(struct ast_endpoint_snapshot *snapshot, const
|
||||
{
|
||||
switch (snapshot->state) {
|
||||
case AST_ENDPOINT_UNKNOWN:
|
||||
ast_statsd_log_string("endpoints.state.unknown", AST_STATSD_GUAGE, delta, 1.0);
|
||||
ast_statsd_log_string("endpoints.state.unknown", AST_STATSD_GAUGE, delta, 1.0);
|
||||
break;
|
||||
case AST_ENDPOINT_OFFLINE:
|
||||
ast_statsd_log_string("endpoints.state.offline", AST_STATSD_GUAGE, delta, 1.0);
|
||||
ast_statsd_log_string("endpoints.state.offline", AST_STATSD_GAUGE, delta, 1.0);
|
||||
break;
|
||||
case AST_ENDPOINT_ONLINE:
|
||||
ast_statsd_log_string("endpoints.state.online", AST_STATSD_GUAGE, delta, 1.0);
|
||||
ast_statsd_log_string("endpoints.state.online", AST_STATSD_GAUGE, delta, 1.0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -62,17 +62,17 @@ static void update_endpoint_state(struct ast_endpoint_snapshot *snapshot, const
|
||||
static void handle_endpoint_update(struct ast_endpoint_snapshot *old_snapshot, struct ast_endpoint_snapshot *new_snapshot)
|
||||
{
|
||||
if (!old_snapshot && new_snapshot) {
|
||||
ast_statsd_log_string("endpoints.count", AST_STATSD_GUAGE, "+1", 1.0);
|
||||
ast_statsd_log_string("endpoints.count", AST_STATSD_GAUGE, "+1", 1.0);
|
||||
update_endpoint_state(new_snapshot, "+1");
|
||||
} else if (old_snapshot && !new_snapshot) {
|
||||
ast_statsd_log_string("endpoints.count", AST_STATSD_GUAGE, "-1", 1.0);
|
||||
ast_statsd_log_string("endpoints.count", AST_STATSD_GAUGE, "-1", 1.0);
|
||||
update_endpoint_state(old_snapshot, "-1");
|
||||
} else {
|
||||
if (old_snapshot->state != new_snapshot->state) {
|
||||
update_endpoint_state(old_snapshot, "-1");
|
||||
update_endpoint_state(new_snapshot, "+1");
|
||||
}
|
||||
ast_statsd_log_full_va("endpoints.%s.%s.channels", AST_STATSD_GUAGE, new_snapshot->num_channels, 1.0,
|
||||
ast_statsd_log_full_va("endpoints.%s.%s.channels", AST_STATSD_GAUGE, new_snapshot->num_channels, 1.0,
|
||||
new_snapshot->tech, new_snapshot->resource);
|
||||
}
|
||||
}
|
||||
|
@@ -1015,7 +1015,7 @@ int ast_sip_initialize_sorcery_location(void)
|
||||
* object before PJSIP options handling is initialized.
|
||||
*/
|
||||
for (i = 0; i < REMOVED; i++) {
|
||||
ast_statsd_log_full_va("PJSIP.contacts.states.%s", AST_STATSD_GUAGE, 0, 1.0, ast_sip_get_contact_status_label(i));
|
||||
ast_statsd_log_full_va("PJSIP.contacts.states.%s", AST_STATSD_GAUGE, 0, 1.0, ast_sip_get_contact_status_label(i));
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@@ -114,7 +114,7 @@ struct ast_sip_contact_status *ast_res_pjsip_find_or_create_contact_status(const
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ast_statsd_log_string_va("PJSIP.contacts.states.%s", AST_STATSD_GUAGE,
|
||||
ast_statsd_log_string_va("PJSIP.contacts.states.%s", AST_STATSD_GAUGE,
|
||||
"+1", 1.0, ast_sip_get_contact_status_label(status->status));
|
||||
|
||||
return status;
|
||||
@@ -148,9 +148,9 @@ static void update_contact_status(const struct ast_sip_contact *contact,
|
||||
update->last_status = status->status;
|
||||
update->status = value;
|
||||
if (update->last_status != update->status) {
|
||||
ast_statsd_log_string_va("PJSIP.contacts.states.%s", AST_STATSD_GUAGE,
|
||||
ast_statsd_log_string_va("PJSIP.contacts.states.%s", AST_STATSD_GAUGE,
|
||||
"-1", 1.0, ast_sip_get_contact_status_label(update->last_status));
|
||||
ast_statsd_log_string_va("PJSIP.contacts.states.%s", AST_STATSD_GUAGE,
|
||||
ast_statsd_log_string_va("PJSIP.contacts.states.%s", AST_STATSD_GAUGE,
|
||||
"+1", 1.0, ast_sip_get_contact_status_label(update->status));
|
||||
}
|
||||
|
||||
|
@@ -619,9 +619,9 @@ static void update_client_state_status(struct sip_outbound_registration_client_s
|
||||
return;
|
||||
}
|
||||
|
||||
ast_statsd_log_string_va("PJSIP.registrations.state.%s", AST_STATSD_GUAGE, "-1", 1.0,
|
||||
ast_statsd_log_string_va("PJSIP.registrations.state.%s", AST_STATSD_GAUGE, "-1", 1.0,
|
||||
sip_outbound_registration_status_str(client_state->status));
|
||||
ast_statsd_log_string_va("PJSIP.registrations.state.%s", AST_STATSD_GUAGE, "+1", 1.0,
|
||||
ast_statsd_log_string_va("PJSIP.registrations.state.%s", AST_STATSD_GAUGE, "+1", 1.0,
|
||||
sip_outbound_registration_status_str(status));
|
||||
client_state->status = status;
|
||||
}
|
||||
@@ -966,8 +966,8 @@ static void sip_outbound_registration_client_state_destroy(void *obj)
|
||||
{
|
||||
struct sip_outbound_registration_client_state *client_state = obj;
|
||||
|
||||
ast_statsd_log_string("PJSIP.registrations.count", AST_STATSD_GUAGE, "-1", 1.0);
|
||||
ast_statsd_log_string_va("PJSIP.registrations.state.%s", AST_STATSD_GUAGE, "-1", 1.0,
|
||||
ast_statsd_log_string("PJSIP.registrations.count", AST_STATSD_GAUGE, "-1", 1.0);
|
||||
ast_statsd_log_string_va("PJSIP.registrations.state.%s", AST_STATSD_GAUGE, "-1", 1.0,
|
||||
sip_outbound_registration_status_str(client_state->status));
|
||||
|
||||
ast_taskprocessor_unreference(client_state->serializer);
|
||||
@@ -998,8 +998,8 @@ static struct sip_outbound_registration_state *sip_outbound_registration_state_a
|
||||
state->client_state->timer.user_data = state->client_state;
|
||||
state->client_state->timer.cb = sip_outbound_registration_timer_cb;
|
||||
|
||||
ast_statsd_log_string("PJSIP.registrations.count", AST_STATSD_GUAGE, "+1", 1.0);
|
||||
ast_statsd_log_string_va("PJSIP.registrations.state.%s", AST_STATSD_GUAGE, "+1", 1.0,
|
||||
ast_statsd_log_string("PJSIP.registrations.count", AST_STATSD_GAUGE, "+1", 1.0);
|
||||
ast_statsd_log_string_va("PJSIP.registrations.state.%s", AST_STATSD_GAUGE, "+1", 1.0,
|
||||
sip_outbound_registration_status_str(state->client_state->status));
|
||||
|
||||
state->registration = ao2_bump(registration);
|
||||
@@ -2035,10 +2035,10 @@ static int load_module(void)
|
||||
ast_manager_register_xml("PJSIPShowRegistrationsOutbound", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, ami_show_outbound_registrations);
|
||||
|
||||
/* Clear any previous statsd gauges in case we weren't shutdown cleanly */
|
||||
ast_statsd_log("PJSIP.registrations.count", AST_STATSD_GUAGE, 0);
|
||||
ast_statsd_log("PJSIP.registrations.state.Registered", AST_STATSD_GUAGE, 0);
|
||||
ast_statsd_log("PJSIP.registrations.state.Unregistered", AST_STATSD_GUAGE, 0);
|
||||
ast_statsd_log("PJSIP.registrations.state.Rejected", AST_STATSD_GUAGE, 0);
|
||||
ast_statsd_log("PJSIP.registrations.count", AST_STATSD_GAUGE, 0);
|
||||
ast_statsd_log("PJSIP.registrations.state.Registered", AST_STATSD_GAUGE, 0);
|
||||
ast_statsd_log("PJSIP.registrations.state.Unregistered", AST_STATSD_GAUGE, 0);
|
||||
ast_statsd_log("PJSIP.registrations.state.Rejected", AST_STATSD_GAUGE, 0);
|
||||
|
||||
/* Load configuration objects */
|
||||
ast_sorcery_load_object(ast_sip_get_sorcery(), "registration");
|
||||
|
Reference in New Issue
Block a user