summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Jordan <mjordan@digium.com>2015-11-24 20:23:10 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2015-11-24 20:23:10 -0600
commite4ba64691754c7873fba52e36c74cfc71e0a053c (patch)
treef31455e56b72f343bde0bd06c6377c1603c024b9
parentfb45130476bf2530a189eda5119dd0e817202ac1 (diff)
parent91346b9fb7d8b6ec2c37ac796904a955a9caf89c (diff)
Merge "Fixed some typos"
-rw-r--r--CHANGES10
-rw-r--r--include/asterisk/statsd.h9
-rw-r--r--res/res_endpoint_stats.c12
-rw-r--r--res/res_pjsip/location.c2
-rw-r--r--res/res_pjsip/pjsip_options.c6
-rw-r--r--res/res_pjsip_outbound_registration.c20
6 files changed, 32 insertions, 27 deletions
diff --git a/CHANGES b/CHANGES
index 5dc81aea6..fb149ce87 100644
--- a/CHANGES
+++ b/CHANGES
@@ -232,9 +232,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
@@ -245,7 +245,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.:
@@ -265,9 +265,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
diff --git a/include/asterisk/statsd.h b/include/asterisk/statsd.h
index c4ecce8f6..4cbd213ad 100644
--- a/include/asterisk/statsd.h
+++ b/include/asterisk/statsd.h
@@ -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,
diff --git a/res/res_endpoint_stats.c b/res/res_endpoint_stats.c
index 8accfd6af..28e47d0d6 100644
--- a/res/res_endpoint_stats.c
+++ b/res/res_endpoint_stats.c
@@ -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);
}
}
diff --git a/res/res_pjsip/location.c b/res/res_pjsip/location.c
index 9cc7f1629..2e0d84b84 100644
--- a/res/res_pjsip/location.c
+++ b/res/res_pjsip/location.c
@@ -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;
diff --git a/res/res_pjsip/pjsip_options.c b/res/res_pjsip/pjsip_options.c
index c7579fdc1..d55a99587 100644
--- a/res/res_pjsip/pjsip_options.c
+++ b/res/res_pjsip/pjsip_options.c
@@ -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));
}
diff --git a/res/res_pjsip_outbound_registration.c b/res/res_pjsip_outbound_registration.c
index e6c3cfecc..88007d1d2 100644
--- a/res/res_pjsip_outbound_registration.c
+++ b/res/res_pjsip_outbound_registration.c
@@ -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");