nats-top

    The nats-top tool provides a dynamic real-time view of a NATS server. nats-top can display a variety of system summary information about the NATS server, such as subscription, pending bytes, number of messages, and more, in real time. For example:

    nats-top can be installed using . For example:

    NOTE: You may have to run the above command as user sudo depending on your setup. If you receive an error that you cannot install nats-top because your $GOPATH is not set, when in fact it is set, use command sudo -E go get github.com/nats-io/nats-top to install nats-top. The -E flag tells sudo to preserve the current user’s environment.

    Once installed, nats-top can be run with the command nats-top and optional arguments.

    While in nats-top view, you can use the following commands.

    Use the o<option> command to set the primary sort key to the value. The option value can be one of the following: cid, subs, pending, msgs_to, msgs_from, bytes_to, bytes_from, lang, version.

    You can also set the sort option on the command line using the flag. For example: nats-top -sort bytes_to.

    Use the n<limit> command to set the sample size of connections to request from the server.

    Note that if n<limit> is used in conjunction with -sort, the server will respect both options allowing queries such as the following: Query for the connection with largest number of subscriptions: nats-top -n 1 -sort subs.

    Use the s command to toggle displaying connection subscriptions.

    Use the ? command to show help message with options.

    Use the command to quit nats-top.