Implement http stats.
This commit is contained in:
parent
cb839d0fe8
commit
0faa1c886a
|
@ -23,6 +23,7 @@ type node struct {
|
||||||
Network interface{} `json:"network"`
|
Network interface{} `json:"network"`
|
||||||
FS interface{} `json:"fs"`
|
FS interface{} `json:"fs"`
|
||||||
Transport interface{} `json:"transport"`
|
Transport interface{} `json:"transport"`
|
||||||
|
HTTP interface{} `json:"http"`
|
||||||
}
|
}
|
||||||
|
|
||||||
const sampleConfig = `
|
const sampleConfig = `
|
||||||
|
@ -127,6 +128,9 @@ func (e *Elasticsearch) gatherUrl(url string, acc plugins.Accumulator) error {
|
||||||
if err := e.parseInterface(acc, "transport", tags, n.Transport); err != nil {
|
if err := e.parseInterface(acc, "transport", tags, n.Transport); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if err := e.parseInterface(acc, "http", tags, n.HTTP); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -82,4 +82,7 @@ func TestElasticsearch(t *testing.T) {
|
||||||
for key, val := range transportExpected {
|
for key, val := range transportExpected {
|
||||||
assert.NoError(t, acc.ValidateTaggedValue(key, val, tags))
|
assert.NoError(t, acc.ValidateTaggedValue(key, val, tags))
|
||||||
}
|
}
|
||||||
|
for key, val := range httpExpected {
|
||||||
|
assert.NoError(t, acc.ValidateTaggedValue(key, val, tags))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -407,6 +407,10 @@ const statsResponse = `
|
||||||
"rx_size_in_bytes": 1380,
|
"rx_size_in_bytes": 1380,
|
||||||
"tx_count": 6,
|
"tx_count": 6,
|
||||||
"tx_size_in_bytes": 1380
|
"tx_size_in_bytes": 1380
|
||||||
|
},
|
||||||
|
"http": {
|
||||||
|
"current_open": 3,
|
||||||
|
"total_opened": 3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -682,3 +686,8 @@ var transportExpected = map[string]float64{
|
||||||
"transport_tx_count": 6,
|
"transport_tx_count": 6,
|
||||||
"transport_tx_size_in_bytes": 1380,
|
"transport_tx_size_in_bytes": 1380,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var httpExpected = map[string]float64{
|
||||||
|
"http_current_open": 3,
|
||||||
|
"http_total_opened": 3,
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue