summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2016-06-03 11:35:49 -0500
committerRichard Mudgett <rmudgett@digium.com>2016-06-09 10:32:07 -0500
commitdcfef53ee2339d09f839aa4e333419b80b309d8a (patch)
tree76193b7e1f9251bdce3aba0c2e57b270794ab797 /include
parent4879cd875c932817c8259934814dd18cf15f5a1c (diff)
stasis: Add setting subscription congestion levels.
Stasis subscriptions and message routers create taskprocessors to process the event messages. API calls are needed to be able to set the congestion levels of these taskprocessors for selected subscriptions and message routers. * Updated CDR, CEL, and manager's stasis subscription congestion levels based upon stress testing. Increased the congestion levels to reduce the potential for bursty call setup/teardown activity from triggering the taskprocessor overload alert. CDRs in particular need an extra high congestion level because they can take awhile to process the stasis messages. ASTERISK-26088 Reported by: Richard Mudgett Change-Id: Id0a716394b4eee746dd158acc63d703902450244
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/stasis.h14
-rw-r--r--include/asterisk/stasis_message_router.h14
2 files changed, 28 insertions, 0 deletions
diff --git a/include/asterisk/stasis.h b/include/asterisk/stasis.h
index 14ab7d93b..62ed1ed1a 100644
--- a/include/asterisk/stasis.h
+++ b/include/asterisk/stasis.h
@@ -591,6 +591,20 @@ struct stasis_subscription *stasis_unsubscribe(
struct stasis_subscription *subscription);
/*!
+ * \brief Set the high and low alert water marks of the stasis subscription.
+ * \since 13.10.0
+ *
+ * \param subscription Pointer to a stasis subscription
+ * \param low_water New queue low water mark. (-1 to set as 90% of high_water)
+ * \param high_water New queue high water mark.
+ *
+ * \retval 0 on success.
+ * \retval -1 on error (water marks not changed).
+ */
+int stasis_subscription_set_congestion_limits(struct stasis_subscription *subscription,
+ long low_water, long high_water);
+
+/*!
* \brief Block until the last message is processed on a subscription.
*
* This function will not return until the \a subscription's callback for the
diff --git a/include/asterisk/stasis_message_router.h b/include/asterisk/stasis_message_router.h
index 89657a5ee..50270a788 100644
--- a/include/asterisk/stasis_message_router.h
+++ b/include/asterisk/stasis_message_router.h
@@ -127,6 +127,20 @@ void stasis_message_router_publish_sync(struct stasis_message_router *router,
struct stasis_message *message);
/*!
+ * \brief Set the high and low alert water marks of the stasis message router.
+ * \since 13.10.0
+ *
+ * \param router Pointer to a stasis message router
+ * \param low_water New queue low water mark. (-1 to set as 90% of high_water)
+ * \param high_water New queue high water mark.
+ *
+ * \retval 0 on success.
+ * \retval -1 on error (water marks not changed).
+ */
+int stasis_message_router_set_congestion_limits(struct stasis_message_router *router,
+ long low_water, long high_water);
+
+/*!
* \brief Add a route to a message router.
*
* A particular \a message_type may have at most one route per \a router. If