mirror of
https://github.com/taigrr/nats.docs
synced 2025-01-18 04:03:23 -08:00
GitBook: [master] 61 pages modified
This commit is contained in:
committed by
gitbook-bot
parent
ed6c1ba06d
commit
de933e912d
@@ -71,29 +71,30 @@ Here you'll find examples demonstrating how to use Prometheus query expressions
|
||||
|
||||
### Pending Messages from Channel Foo
|
||||
|
||||
```
|
||||
```text
|
||||
sum(nss_chan_subs_pending_count{channel="foo"}) by (client_id)
|
||||
```
|
||||
|
||||
<img width="1580" alt="Pending" src="https://user-images.githubusercontent.com/26195/54960400-b0c52e80-4f19-11e9-9e92-88fba89fd55e.png">
|
||||

|
||||
|
||||
### Messages Per Sec Delivered on Channel Foo
|
||||
|
||||
In this case, `3` is the size of the quorum of NATS Streaming Server nodes. In case of a single instance backed by a relational database we would set it to `1`:
|
||||
In this case, `3` is the size of the quorum of NATS Streaming Server nodes. In case of a single instance backed by a relational database we would set it to `1`:
|
||||
|
||||
```
|
||||
```text
|
||||
sum(rate(nss_chan_msgs_total{channel="foo"}[5m])) by (channel) / 3
|
||||
```
|
||||
|
||||
<img width="1579" alt="msgs-per-sec" src="https://user-images.githubusercontent.com/26195/54960588-80ca5b00-4f1a-11e9-92d5-de59c81b6c63.png">
|
||||

|
||||
|
||||
### Msgs/Sec vs Pending on Channel
|
||||
|
||||
Example of combining the rate of messages with the pending count to detect whether processing is getting behind:
|
||||
|
||||
```
|
||||
```text
|
||||
sum(rate(nss_chan_msgs_total{channel="foo"}[5m])) by (channel) / 3
|
||||
sum(nss_chan_subs_pending_count{channel="foo"}) by (channel) / 3
|
||||
```
|
||||
|
||||
<img width="1468" alt="combination" src="https://user-images.githubusercontent.com/26195/54960992-4235a000-4f1c-11e9-8e55-47515a5d944d.png">
|
||||

|
||||
|
||||
|
||||
Reference in New Issue
Block a user