When starting a server with the monitor port enabled `-m <port number>`, the NATS Server can provide statistics for different endpoints. For instance, if server runs on host `nats_host` and has been started with monitor port 8222 `gnatsd -m 8222`, you could check the subscriptions with `
http://nats_host:8222/connz?subs=1`. It would return something like:
{
"now": "2016-09-23T12:24:49.185477595-06:00",
"num_connections": 2,
"total": 2,
"offset": 0,
"limit": 1024,
"connections": [
{
"cid": 11,
"ip": "::1",
"port": 58903,
"start": "2016-09-23T12:24:47.705340926-06:00",
"last_activity": "2016-09-23T12:24:47.705756232-06:00",
"uptime": "1s",
"idle": "1s",
"pending_bytes": 0,
"in_msgs": 0,
"out_msgs": 0,
"in_bytes": 0,
"out_bytes": 0,
"subscriptions": 1,
"lang": "go",
"version": "1.2.2",
"subscriptions_list": [
"foo"
]
},
{
"cid": 12,
"ip": "::1",
"port": 58904,
"start": "2016-09-23T12:24:47.705492986-06:00",
"last_activity": "2016-09-23T12:24:47.70579662-06:00",
"uptime": "1s",
"idle": "1s",
"pending_bytes": 0,
"in_msgs": 0,
"out_msgs": 0,
"in_bytes": 0,
"out_bytes": 0,
"subscriptions": 1,
"lang": "go",
"version": "1.2.2",
"subscriptions_list": [
"foo"
]
}
]
}