Updated haproxy_test.go to reflect CSV field names.

This commit is contained in:
Greg Linton 2016-05-11 08:14:24 -04:00
parent 53caeca645
commit ccb521b422
1 changed files with 105 additions and 90 deletions

View File

@ -73,22 +73,26 @@ func TestHaproxyGeneratesMetricsWithAuthentication(t *testing.T) {
} }
fields := map[string]interface{}{ fields := map[string]interface{}{
"active_servers": uint64(1), "act": uint64(1),
"backup_servers": uint64(0), "bck": uint64(0),
"bin": uint64(510913516), "bin": uint64(510913516),
"bout": uint64(2193856571), "bout": uint64(2193856571),
"check_duration": uint64(10), "check_duration": uint64(10),
"cli_abort": uint64(73), "chkdown": uint64(0),
"chkfail": uint64(1),
"cli_abrt": uint64(73),
"ctime": uint64(2), "ctime": uint64(2),
"downtime": uint64(0), "downtime": uint64(0),
"dresp": uint64(0), "dresp": uint64(0),
"econ": uint64(0), "econ": uint64(0),
"eresp": uint64(1), "eresp": uint64(1),
"http_response.1xx": uint64(0), "hanafail": uint64(0),
"http_response.2xx": uint64(119534), "hrsp_1xx": uint64(0),
"http_response.3xx": uint64(48051), "hrsp_2xx": uint64(119534),
"http_response.4xx": uint64(2345), "hrsp_3xx": uint64(48051),
"http_response.5xx": uint64(1056), "hrsp_4xx": uint64(2345),
"hrsp_5xx": uint64(1056),
"hrsp_other": uint64(0),
"lbtot": uint64(171013), "lbtot": uint64(171013),
"qcur": uint64(0), "qcur": uint64(0),
"qmax": uint64(0), "qmax": uint64(0),
@ -98,9 +102,10 @@ func TestHaproxyGeneratesMetricsWithAuthentication(t *testing.T) {
"rtime": uint64(312), "rtime": uint64(312),
"scur": uint64(1), "scur": uint64(1),
"smax": uint64(32), "smax": uint64(32),
"srv_abort": uint64(1), "srv_abrt": uint64(1),
"stot": uint64(171014), "stot": uint64(171014),
"ttime": uint64(2341), "ttime": uint64(2341),
"weight": uint(100),
"wredis": uint64(0), "wredis": uint64(0),
"wretr": uint64(1), "wretr": uint64(1),
} }
@ -137,22 +142,26 @@ func TestHaproxyGeneratesMetricsWithoutAuthentication(t *testing.T) {
} }
fields := map[string]interface{}{ fields := map[string]interface{}{
"active_servers": uint64(1), "act": uint64(1),
"backup_servers": uint64(0), "bck": uint64(0),
"bin": uint64(510913516), "bin": uint64(510913516),
"bout": uint64(2193856571), "bout": uint64(2193856571),
"check_duration": uint64(10), "check_duration": uint64(10),
"cli_abort": uint64(73), "chkdown": uint64(0),
"chkfail": uint64(1),
"cli_abrt": uint64(73),
"ctime": uint64(2), "ctime": uint64(2),
"downtime": uint64(0), "downtime": uint64(0),
"dresp": uint64(0), "dresp": uint64(0),
"econ": uint64(0), "econ": uint64(0),
"eresp": uint64(1), "eresp": uint64(1),
"http_response.1xx": uint64(0), "hanafail": uint64(0),
"http_response.2xx": uint64(119534), "hrsp_1xx": uint64(0),
"http_response.3xx": uint64(48051), "hrsp_2xx": uint64(119534),
"http_response.4xx": uint64(2345), "hrsp_3xx": uint64(48051),
"http_response.5xx": uint64(1056), "hrsp_4xx": uint64(2345),
"hrsp_5xx": uint64(1056),
"hrsp_other": uint64(0),
"lbtot": uint64(171013), "lbtot": uint64(171013),
"qcur": uint64(0), "qcur": uint64(0),
"qmax": uint64(0), "qmax": uint64(0),
@ -162,9 +171,10 @@ func TestHaproxyGeneratesMetricsWithoutAuthentication(t *testing.T) {
"rtime": uint64(312), "rtime": uint64(312),
"scur": uint64(1), "scur": uint64(1),
"smax": uint64(32), "smax": uint64(32),
"srv_abort": uint64(1), "srv_abrt": uint64(1),
"stot": uint64(171014), "stot": uint64(171014),
"ttime": uint64(2341), "ttime": uint64(2341),
"weight": uint(100),
"wredis": uint64(0), "wredis": uint64(0),
"wretr": uint64(1), "wretr": uint64(1),
} }
@ -200,22 +210,26 @@ func TestHaproxyGeneratesMetricsUsingSocket(t *testing.T) {
} }
fields := map[string]interface{}{ fields := map[string]interface{}{
"active_servers": uint64(1), "act": uint64(1),
"backup_servers": uint64(0), "bck": uint64(0),
"bin": uint64(510913516), "bin": uint64(510913516),
"bout": uint64(2193856571), "bout": uint64(2193856571),
"check_duration": uint64(10), "check_duration": uint64(10),
"cli_abort": uint64(73), "chkdown": uint64(0),
"chkfail": uint64(1),
"cli_abrt": uint64(73),
"ctime": uint64(2), "ctime": uint64(2),
"downtime": uint64(0), "downtime": uint64(0),
"dresp": uint64(0), "dresp": uint64(0),
"econ": uint64(0), "econ": uint64(0),
"eresp": uint64(1), "eresp": uint64(1),
"http_response.1xx": uint64(0), "hanafail": uint64(0),
"http_response.2xx": uint64(119534), "hrsp_1xx": uint64(0),
"http_response.3xx": uint64(48051), "hrsp_2xx": uint64(119534),
"http_response.4xx": uint64(2345), "hrsp_3xx": uint64(48051),
"http_response.5xx": uint64(1056), "hrsp_4xx": uint64(2345),
"hrsp_5xx": uint64(1056),
"hrsp_other": uint64(0),
"lbtot": uint64(171013), "lbtot": uint64(171013),
"qcur": uint64(0), "qcur": uint64(0),
"qmax": uint64(0), "qmax": uint64(0),
@ -225,9 +239,10 @@ func TestHaproxyGeneratesMetricsUsingSocket(t *testing.T) {
"rtime": uint64(312), "rtime": uint64(312),
"scur": uint64(1), "scur": uint64(1),
"smax": uint64(32), "smax": uint64(32),
"srv_abort": uint64(1), "srv_abrt": uint64(1),
"stot": uint64(171014), "stot": uint64(171014),
"ttime": uint64(2341), "ttime": uint64(2341),
"weight": uint(100),
"wredis": uint64(0), "wredis": uint64(0),
"wretr": uint64(1), "wretr": uint64(1),
} }