summaryrefslogtreecommitdiff
path: root/include/asterisk
diff options
context:
space:
mode:
authorzuul <zuul@gerrit.asterisk.org>2016-06-09 20:12:30 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2016-06-09 20:12:30 -0500
commit1ac47c5aae82da390fd46b0ce06d10688bcee23d (patch)
tree34b3d858c44f08676cd71a93f51f051b1e51f495 /include/asterisk
parent2204a6e6f173da52d570f5eccaea3ed8d11486bc (diff)
parent610eee2a36d2d2426947784a230c31dca6b18c62 (diff)
Merge "taskprocessors: Implement high/low water mark alerts." into 13
Diffstat (limited to 'include/asterisk')
-rw-r--r--include/asterisk/taskprocessor.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/asterisk/taskprocessor.h b/include/asterisk/taskprocessor.h
index af3ce747f..e51122269 100644
--- a/include/asterisk/taskprocessor.h
+++ b/include/asterisk/taskprocessor.h
@@ -59,6 +59,7 @@ struct ast_taskprocessor;
/*! \brief Suggested maximum taskprocessor name length (less null terminator). */
#define AST_TASKPROCESSOR_MAX_NAME 45
+/*! Default taskprocessor high water level alert trigger */
#define AST_TASKPROCESSOR_HIGH_WATER_LEVEL 500
/*!
@@ -297,4 +298,26 @@ const char *ast_taskprocessor_name(struct ast_taskprocessor *tps);
*/
long ast_taskprocessor_size(struct ast_taskprocessor *tps);
+/*!
+ * \brief Get the current taskprocessor high water alert count.
+ * \since 13.10.0
+ *
+ * \retval 0 if no taskprocessors are in high water alert.
+ * \retval non-zero if some task processors are in high water alert.
+ */
+unsigned int ast_taskprocessor_alert_get(void);
+
+/*!
+ * \brief Set the high and low alert water marks of the given taskprocessor queue.
+ * \since 13.10.0
+ *
+ * \param tps Taskprocessor to update queue water marks.
+ * \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 ast_taskprocessor_alert_set_levels(struct ast_taskprocessor *tps, long low_water, long high_water);
+
#endif /* __AST_TASKPROCESSOR_H__ */