Implement network stats.
This commit is contained in:
parent
ac54b7cdd1
commit
4743c9ab16
|
@ -20,6 +20,7 @@ type node struct {
|
||||||
Process interface{} `json:"process"`
|
Process interface{} `json:"process"`
|
||||||
JVM interface{} `json:"jvm"`
|
JVM interface{} `json:"jvm"`
|
||||||
ThreadPool interface{} `json:"thread_pool"`
|
ThreadPool interface{} `json:"thread_pool"`
|
||||||
|
Network interface{} `json:"network"`
|
||||||
}
|
}
|
||||||
|
|
||||||
const sampleConfig = `
|
const sampleConfig = `
|
||||||
|
@ -115,6 +116,9 @@ func (e *Elasticsearch) gatherUrl(url string, acc plugins.Accumulator) error {
|
||||||
if err := e.parseInterface(acc, "thread_pool", tags, n.ThreadPool); err != nil {
|
if err := e.parseInterface(acc, "thread_pool", tags, n.ThreadPool); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if err := e.parseInterface(acc, "network", tags, n.Network); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -70,4 +70,8 @@ func TestElasticsearch(t *testing.T) {
|
||||||
for key, val := range threadPoolExpected {
|
for key, val := range threadPoolExpected {
|
||||||
assert.NoError(t, acc.ValidateTaggedValue(key, val, tags))
|
assert.NoError(t, acc.ValidateTaggedValue(key, val, tags))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for key, val := range networkExpected {
|
||||||
|
assert.NoError(t, acc.ValidateTaggedValue(key, val, tags))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -367,6 +367,20 @@ const statsResponse = `
|
||||||
"largest": 1,
|
"largest": 1,
|
||||||
"completed": 0
|
"completed": 0
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"network": {
|
||||||
|
"tcp": {
|
||||||
|
"active_opens": 13,
|
||||||
|
"passive_opens": 16,
|
||||||
|
"curr_estab": 29,
|
||||||
|
"in_segs": 113,
|
||||||
|
"out_segs": 97,
|
||||||
|
"retrans_segs": 0,
|
||||||
|
"estab_resets": 0,
|
||||||
|
"attempt_fails": 0,
|
||||||
|
"in_errs": 0,
|
||||||
|
"out_rsts": 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -614,3 +628,16 @@ var threadPoolExpected = map[string]float64{
|
||||||
"thread_pool_flush_largest": 5,
|
"thread_pool_flush_largest": 5,
|
||||||
"thread_pool_flush_completed": 3,
|
"thread_pool_flush_completed": 3,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var networkExpected = map[string]float64{
|
||||||
|
"network_tcp_in_errs": 0,
|
||||||
|
"network_tcp_passive_opens": 16,
|
||||||
|
"network_tcp_curr_estab": 29,
|
||||||
|
"network_tcp_in_segs": 113,
|
||||||
|
"network_tcp_out_segs": 97,
|
||||||
|
"network_tcp_retrans_segs": 0,
|
||||||
|
"network_tcp_attempt_fails": 0,
|
||||||
|
"network_tcp_active_opens": 13,
|
||||||
|
"network_tcp_estab_resets": 0,
|
||||||
|
"network_tcp_out_rsts": 0,
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue