[asterisk-commits] Fixed some typos (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Nov 24 20:23:06 CST 2015


Matt Jordan has submitted this change and it was merged.

Change subject: Fixed some typos
......................................................................


Fixed some typos

Fixes some minor typos in the CHANGES file, plus an embarrasing typo in
the StatsD API.

Change-Id: I9ca4858c64a4a07d2643b81baa64baebb27a4eb7
---
M CHANGES
M include/asterisk/statsd.h
M res/res_endpoint_stats.c
M res/res_pjsip/location.c
M res/res_pjsip/pjsip_options.c
M res/res_pjsip_outbound_registration.c
6 files changed, 32 insertions(+), 27 deletions(-)

Approvals:
  Anonymous Coward #1000019: Verified
  Matt Jordan: Looks good to me, approved



diff --git a/CHANGES b/CHANGES
index 6dd5efd..cd8a736 100644
--- a/CHANGES
+++ b/CHANGES
@@ -44,9 +44,9 @@
  * 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 @@
 
  * 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 @@
 -------------------
  * 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 c4ecce8..4cbd213 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 @@
  *
  * 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 1e1123e..6b84794 100644
--- a/res/res_endpoint_stats.c
+++ b/res/res_endpoint_stats.c
@@ -48,13 +48,13 @@
 {
 	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 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 9cc7f16..2e0d84b 100644
--- a/res/res_pjsip/location.c
+++ b/res/res_pjsip/location.c
@@ -1015,7 +1015,7 @@
 	 * 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 58519a9..b172489 100644
--- a/res/res_pjsip/pjsip_options.c
+++ b/res/res_pjsip/pjsip_options.c
@@ -114,7 +114,7 @@
 		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 @@
 	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 6f3155d..4ba5748 100644
--- a/res/res_pjsip_outbound_registration.c
+++ b/res/res_pjsip_outbound_registration.c
@@ -619,9 +619,9 @@
 		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 @@
 {
 	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 @@
 	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 @@
 	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");

-- 
To view, visit https://gerrit.asterisk.org/1707
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9ca4858c64a4a07d2643b81baa64baebb27a4eb7
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: David M. Lee <dlee at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-commits mailing list