Search the Asterisk Blog

stasis: Statistics CLI Commands

By Joshua C. Colp

Previously on this blog I talked about a new feature to internally filter messages in our internal message bus, as well as a new caching implementation for it. When these were being developed logging had to be manually added to understand the impact. As of the next version of Asterisk a new feature will be available for developers to get some of this information in a more defined mechanism.

Stasis statistics gathering is enabled when Asterisk is built in developer mode and collects statistics on stasis usage and execution. This can be useful if you are wanting to understand the performance of parts of stasis. It provides the following CLI commands:

In the case of both “stasis statistics show subscription” and “stasis statistics show topic” tab completion is available for the names.

For “stasis statistics show messages” the usage of specific message types will be output:

We can see here that for a few message types we created messages for them, but there was no subscriber interested in receiving them. This could be a future improvement – not even creating the messages at all in this case.

For “stasis statistics show subscriptions” we get general information about messages that were either dropped by a subscriber or actually accepted by it, as well as processing time.

For “stasis statistics show topics” we receive similar information except at a more high-level perspective. This allows you to see whether ANY subscriber on a topic wanted a message or not and the processing time. You may note that there are two topics with the same name here. Currently topic names are not guaranteed to be unique across the system. This will be improved in the future to not just be unique but to also provide more information in the topic name about what the topic is for.

For “stasis statistics show subscription” we get more detailed information about subscriptions. Normally it would be difficult to know what a subscription is actually for or where it originated from but thanks to this CLI command this information is now available.

Finally we have “stasis statistics show topic” which provides a bit more information.

Using these CLI commands provides better insight into how exactly stasis is being used and what users of stasis may take a long time to process their messages. This ensures that for stasis improvements we focus on the aspects that actually make an impact to users, and not just areas we think would improve things.

No Comments Yet

Get the conversation started!

Add to the Discussion

Your email address will not be published. Required fields are marked *

About the Author

Joshua C. Colp

Joshua Colp is a Senior Software Developer at Digium and a long time Asterisk developer. He originally started in the community submitting simple patches and grew into improving and creating new core components of Asterisk itself. He is a self-taught programmer who believes in finding the balance between doing things the way they should be done and doing what is right for the people using the software. In his spare time he enjoys smashing fax machines.

See All of Joshua C.'s Articles