Run `make fmt` with Go 1.11
This commit is contained in:
parent
454c3be2d2
commit
f38da90329
|
@ -248,30 +248,30 @@ func HaproxyGetFieldValues() map[string]interface{} {
|
||||||
"http_response.4xx": uint64(140),
|
"http_response.4xx": uint64(140),
|
||||||
"http_response.5xx": uint64(0),
|
"http_response.5xx": uint64(0),
|
||||||
"http_response.other": uint64(0),
|
"http_response.other": uint64(0),
|
||||||
"iid": uint64(4),
|
"iid": uint64(4),
|
||||||
"last_chk": "OK",
|
"last_chk": "OK",
|
||||||
"lastchg": uint64(1036557),
|
"lastchg": uint64(1036557),
|
||||||
"lastsess": int64(1342),
|
"lastsess": int64(1342),
|
||||||
"lbtot": uint64(9481),
|
"lbtot": uint64(9481),
|
||||||
"mode": "http",
|
"mode": "http",
|
||||||
"pid": uint64(1),
|
"pid": uint64(1),
|
||||||
"qcur": uint64(0),
|
"qcur": uint64(0),
|
||||||
"qmax": uint64(0),
|
"qmax": uint64(0),
|
||||||
"qtime": uint64(1268),
|
"qtime": uint64(1268),
|
||||||
"rate": uint64(0),
|
"rate": uint64(0),
|
||||||
"rate_max": uint64(2),
|
"rate_max": uint64(2),
|
||||||
"rtime": uint64(2908),
|
"rtime": uint64(2908),
|
||||||
"sid": uint64(1),
|
"sid": uint64(1),
|
||||||
"scur": uint64(0),
|
"scur": uint64(0),
|
||||||
"slim": uint64(2),
|
"slim": uint64(2),
|
||||||
"smax": uint64(2),
|
"smax": uint64(2),
|
||||||
"srv_abort": uint64(0),
|
"srv_abort": uint64(0),
|
||||||
"status": "UP",
|
"status": "UP",
|
||||||
"stot": uint64(14539),
|
"stot": uint64(14539),
|
||||||
"ttime": uint64(4500),
|
"ttime": uint64(4500),
|
||||||
"weight": uint64(1),
|
"weight": uint64(1),
|
||||||
"wredis": uint64(0),
|
"wredis": uint64(0),
|
||||||
"wretr": uint64(0),
|
"wretr": uint64(0),
|
||||||
}
|
}
|
||||||
return fields
|
return fields
|
||||||
}
|
}
|
||||||
|
|
|
@ -202,10 +202,10 @@ var (
|
||||||
"deleting": uint32(0),
|
"deleting": uint32(0),
|
||||||
"executing": uint32(0),
|
"executing": uint32(0),
|
||||||
"execution of init_command": uint32(0),
|
"execution of init_command": uint32(0),
|
||||||
"end": uint32(0),
|
"end": uint32(0),
|
||||||
"freeing items": uint32(0),
|
"freeing items": uint32(0),
|
||||||
"flushing tables": uint32(0),
|
"flushing tables": uint32(0),
|
||||||
"fulltext initialization": uint32(0),
|
"fulltext initialization": uint32(0),
|
||||||
"idle": uint32(0),
|
"idle": uint32(0),
|
||||||
"init": uint32(0),
|
"init": uint32(0),
|
||||||
"killed": uint32(0),
|
"killed": uint32(0),
|
||||||
|
@ -241,8 +241,8 @@ var (
|
||||||
}
|
}
|
||||||
// plaintext statuses
|
// plaintext statuses
|
||||||
stateStatusMappings = map[string]string{
|
stateStatusMappings = map[string]string{
|
||||||
"user sleep": "idle",
|
"user sleep": "idle",
|
||||||
"creating index": "altering table",
|
"creating index": "altering table",
|
||||||
"committing alter table to storage engine": "altering table",
|
"committing alter table to storage engine": "altering table",
|
||||||
"discard or import tablespace": "altering table",
|
"discard or import tablespace": "altering table",
|
||||||
"rename": "altering table",
|
"rename": "altering table",
|
||||||
|
|
|
@ -776,10 +776,10 @@ func TestGatherHttpCachesMetrics(t *testing.T) {
|
||||||
t,
|
t,
|
||||||
"nginx_plus_api_http_caches",
|
"nginx_plus_api_http_caches",
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"bypass_bytes": int64(5510647548),
|
"bypass_bytes": int64(5510647548),
|
||||||
"bypass_bytes_written": int64(44992),
|
"bypass_bytes_written": int64(44992),
|
||||||
"bypass_responses": int64(200187),
|
"bypass_responses": int64(200187),
|
||||||
"bypass_responses_written": int64(200173),
|
"bypass_responses_written": int64(200173),
|
||||||
"cold": false,
|
"cold": false,
|
||||||
"expired_bytes": int64(1656847080),
|
"expired_bytes": int64(1656847080),
|
||||||
"expired_bytes_written": int64(1641825173),
|
"expired_bytes_written": int64(1641825173),
|
||||||
|
@ -810,10 +810,10 @@ func TestGatherHttpCachesMetrics(t *testing.T) {
|
||||||
t,
|
t,
|
||||||
"nginx_plus_api_http_caches",
|
"nginx_plus_api_http_caches",
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"bypass_bytes": int64(5510647548),
|
"bypass_bytes": int64(5510647548),
|
||||||
"bypass_bytes_written": int64(44992),
|
"bypass_bytes_written": int64(44992),
|
||||||
"bypass_responses": int64(200187),
|
"bypass_responses": int64(200187),
|
||||||
"bypass_responses_written": int64(200173),
|
"bypass_responses_written": int64(200173),
|
||||||
"cold": false,
|
"cold": false,
|
||||||
"expired_bytes": int64(1656847080),
|
"expired_bytes": int64(1656847080),
|
||||||
"expired_bytes_written": int64(1641825173),
|
"expired_bytes_written": int64(1641825173),
|
||||||
|
|
|
@ -36,8 +36,8 @@ func newTestUdpListener() (*UdpListener, chan []byte) {
|
||||||
listener := &UdpListener{
|
listener := &UdpListener{
|
||||||
ServiceAddress: ":8125",
|
ServiceAddress: ":8125",
|
||||||
AllowedPendingMessages: 10000,
|
AllowedPendingMessages: 10000,
|
||||||
in: in,
|
in: in,
|
||||||
done: make(chan struct{}),
|
done: make(chan struct{}),
|
||||||
}
|
}
|
||||||
return listener, in
|
return listener, in
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ var testInput = []byte(`Inter-| sta-| Quality | Discarded packets
|
||||||
|
|
||||||
func TestLoadWirelessTable(t *testing.T) {
|
func TestLoadWirelessTable(t *testing.T) {
|
||||||
expectedMetrics := []*wirelessInterface{
|
expectedMetrics := []*wirelessInterface{
|
||||||
&wirelessInterface{
|
{
|
||||||
Interface: "wlan0",
|
Interface: "wlan0",
|
||||||
Status: int64(0000),
|
Status: int64(0000),
|
||||||
Link: int64(60),
|
Link: int64(60),
|
||||||
|
@ -28,7 +28,7 @@ func TestLoadWirelessTable(t *testing.T) {
|
||||||
Misc: int64(0),
|
Misc: int64(0),
|
||||||
Beacon: int64(0),
|
Beacon: int64(0),
|
||||||
},
|
},
|
||||||
&wirelessInterface{
|
{
|
||||||
Interface: "wlan1",
|
Interface: "wlan1",
|
||||||
Status: int64(0000),
|
Status: int64(0000),
|
||||||
Link: int64(70),
|
Link: int64(70),
|
||||||
|
|
|
@ -106,9 +106,9 @@ func TestParseValidEmbeddedCounterJSON(t *testing.T) {
|
||||||
"count": float64(1),
|
"count": float64(1),
|
||||||
}, metrics[0].Fields())
|
}, metrics[0].Fields())
|
||||||
assert.Equal(t, map[string]string{
|
assert.Equal(t, map[string]string{
|
||||||
"metric_type": "counter",
|
"metric_type": "counter",
|
||||||
"tag1": "green",
|
"tag1": "green",
|
||||||
"tag2": "yellow",
|
"tag2": "yellow",
|
||||||
"tag3 space,comma=equals": "red ,=",
|
"tag3 space,comma=equals": "red ,=",
|
||||||
}, metrics[0].Tags())
|
}, metrics[0].Tags())
|
||||||
assert.True(t, metricTime.Equal(metrics[0].Time()), fmt.Sprintf("%s should be equal to %s", metrics[0].Time(), metricTime))
|
assert.True(t, metricTime.Equal(metrics[0].Time()), fmt.Sprintf("%s should be equal to %s", metrics[0].Time(), metricTime))
|
||||||
|
|
Loading…
Reference in New Issue