Add HTTP 5xx stats to HAProxy plugin. Closes #194

This commit is contained in:
Oliver Buschjost 2015-09-16 22:55:55 +02:00 committed by Cameron Sparr
parent d979ee5573
commit 211065565f
2 changed files with 6 additions and 0 deletions

View File

@ -245,6 +245,11 @@ func importCsvResult(r io.Reader, acc plugins.Accumulator, host string) ([][]str
if err == nil {
acc.Add("http_response.4xx", ival, tags)
}
case HF_HRSP_5xx:
ival, err := strconv.ParseUint(v, 10, 64)
if err == nil {
acc.Add("http_response.5xx", ival, tags)
}
case HF_EREQ:
ival, err := strconv.ParseUint(v, 10, 64)
if err == nil {

View File

@ -60,6 +60,7 @@ func TestHaproxyGeneratesMetricsWithAuthentication(t *testing.T) {
{"http_response.2xx", 1314093},
{"http_response.3xx", 537036},
{"http_response.4xx", 123452},
{"http_response.5xx", 11966},
{"dreq", 1102},
{"dresp", 80},
{"wretr", 17},