Add per node memory stats to rabbitmq input (#6326)
This commit is contained in:
committed by
Daniel Nelson
parent
80f38ae352
commit
32de8bb459
@@ -6,10 +6,11 @@ import (
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/influxdata/telegraf/testutil"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"io/ioutil"
|
||||
)
|
||||
|
||||
func TestRabbitMQGeneratesMetrics(t *testing.T) {
|
||||
@@ -27,6 +28,8 @@ func TestRabbitMQGeneratesMetrics(t *testing.T) {
|
||||
jsonFilePath = "testdata/exchanges.json"
|
||||
case "/api/healthchecks/node/rabbit@vagrant-ubuntu-trusty-64":
|
||||
jsonFilePath = "testdata/healthchecks.json"
|
||||
case "/api/nodes/rabbit@vagrant-ubuntu-trusty-64/memory":
|
||||
jsonFilePath = "testdata/memory.json"
|
||||
default:
|
||||
panic("Cannot handle request")
|
||||
}
|
||||
@@ -129,6 +132,26 @@ func TestRabbitMQGeneratesMetrics(t *testing.T) {
|
||||
"io_write_avg_time_rate": 4.32,
|
||||
"io_write_bytes": 823,
|
||||
"io_write_bytes_rate": 32.8,
|
||||
"mem_connection_readers": 1234,
|
||||
"mem_connection_writers": 5678,
|
||||
"mem_connection_channels": 1133,
|
||||
"mem_connection_other": 2840,
|
||||
"mem_queue_procs": 2840,
|
||||
"mem_queue_slave_procs": 0,
|
||||
"mem_plugins": 1755976,
|
||||
"mem_other_proc": 23056584,
|
||||
"mem_metrics": 196536,
|
||||
"mem_mgmt_db": 491272,
|
||||
"mem_mnesia": 115600,
|
||||
"mem_other_ets": 2121872,
|
||||
"mem_binary": 418848,
|
||||
"mem_msg_index": 42848,
|
||||
"mem_code": 25179322,
|
||||
"mem_atom": 1041593,
|
||||
"mem_other_system": 14741981,
|
||||
"mem_allocated_unused": 38208528,
|
||||
"mem_reserved_unallocated": 0,
|
||||
"mem_total": 83025920,
|
||||
}
|
||||
compareMetrics(t, nodeMetrics, acc, "rabbitmq_node")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user