mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
stasis: Add statistics gathering in developer mode.
This change adds statistics gathering to Stasis topics, subscriptions, and message types. These can be viewed using CLI commands and provide insight into how Stasis is used and how long certain operations take to execute. These are only available when Asterisk is compiled in developer mode and do not have any impact under normal operation. ASTERISK-28117 Change-Id: I94411b53767f89ee01714daaecf0c2f1666e863f
This commit is contained in:
@@ -604,8 +604,14 @@ void stasis_subscription_cb_noop(void *data, struct stasis_subscription *sub, st
|
||||
* has been subscribed. This occurs immediately before accepted message
|
||||
* types can be set and the callback must expect to receive it.
|
||||
*/
|
||||
#ifdef AST_DEVMODE
|
||||
struct stasis_subscription *__stasis_subscribe(struct stasis_topic *topic,
|
||||
stasis_subscription_cb callback, void *data, const char *file, int lineno, const char *func);
|
||||
#define stasis_subscribe(topic, callback, data) __stasis_subscribe(topic, callback, data, __FILE__, __LINE__, __PRETTY_FUNCTION__)
|
||||
#else
|
||||
struct stasis_subscription *stasis_subscribe(struct stasis_topic *topic,
|
||||
stasis_subscription_cb callback, void *data);
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* \brief Create a subscription whose callbacks occur on a thread pool
|
||||
@@ -633,8 +639,14 @@ struct stasis_subscription *stasis_subscribe(struct stasis_topic *topic,
|
||||
* has been subscribed. This occurs immediately before accepted message
|
||||
* types can be set and the callback must expect to receive it.
|
||||
*/
|
||||
#ifdef AST_DEVMODE
|
||||
struct stasis_subscription *__stasis_subscribe_pool(struct stasis_topic *topic,
|
||||
stasis_subscription_cb callback, void *data, const char *file, int lineno, const char *func);
|
||||
#define stasis_subscribe_pool(topic, callback, data) __stasis_subscribe_pool(topic, callback, data, __FILE__, __LINE__, __PRETTY_FUNCTION__)
|
||||
#else
|
||||
struct stasis_subscription *stasis_subscribe_pool(struct stasis_topic *topic,
|
||||
stasis_subscription_cb callback, void *data);
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* \brief Indicate to a subscription that we are interested in a message type.
|
||||
|
@@ -60,11 +60,23 @@
|
||||
* \return \c NULL on error.
|
||||
* \since 12
|
||||
*/
|
||||
#ifdef AST_DEVMODE
|
||||
struct stasis_subscription *internal_stasis_subscribe(
|
||||
struct stasis_topic *topic,
|
||||
stasis_subscription_cb callback,
|
||||
void *data,
|
||||
int needs_mailbox,
|
||||
int use_thread_pool,
|
||||
const char *file,
|
||||
int lineno,
|
||||
const char *func);
|
||||
#else
|
||||
struct stasis_subscription *internal_stasis_subscribe(
|
||||
struct stasis_topic *topic,
|
||||
stasis_subscription_cb callback,
|
||||
void *data,
|
||||
int needs_mailbox,
|
||||
int use_thread_pool);
|
||||
#endif
|
||||
|
||||
#endif /* STASIS_INTERNAL_H_ */
|
||||
|
@@ -55,8 +55,14 @@ struct stasis_message_router;
|
||||
*
|
||||
* \since 12
|
||||
*/
|
||||
#ifdef AST_DEVMODE
|
||||
struct stasis_message_router *__stasis_message_router_create(
|
||||
struct stasis_topic *topic, const char *file, int lineno, const char *func);
|
||||
#define stasis_message_router_create(topic) __stasis_message_router_create(topic, __FILE__, __LINE__, __PRETTY_FUNCTION__)
|
||||
#else
|
||||
struct stasis_message_router *stasis_message_router_create(
|
||||
struct stasis_topic *topic);
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* \brief Create a new message router object.
|
||||
@@ -71,8 +77,14 @@ struct stasis_message_router *stasis_message_router_create(
|
||||
*
|
||||
* \since 12.8.0
|
||||
*/
|
||||
#ifdef AST_DEVMODE
|
||||
struct stasis_message_router *__stasis_message_router_create_pool(
|
||||
struct stasis_topic *topic, const char *file, int lineno, const char *func);
|
||||
#define stasis_message_router_create_pool(topic) __stasis_message_router_create_pool(topic, __FILE__, __LINE__, __PRETTY_FUNCTION__)
|
||||
#else
|
||||
struct stasis_message_router *stasis_message_router_create_pool(
|
||||
struct stasis_topic *topic);
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* \brief Unsubscribe the router from the upstream topic.
|
||||
|
Reference in New Issue
Block a user