Re-order test data with struct definition
parent
dd93ce2fe2
commit
c3e6ea2701
|
@ -210,22 +210,18 @@ func TestUnmarshal_Points(t *testing.T) {
|
|||
}{
|
||||
{
|
||||
name: "single value",
|
||||
points: []influxdb.Point{
|
||||
{Name: "disk_read", Fields: map[string]interface{}{"disk_read": float64(1)}},
|
||||
},
|
||||
packet: gollectd.Packet{
|
||||
Plugin: "disk",
|
||||
Values: []gollectd.Value{
|
||||
{Name: "read", Value: 1},
|
||||
},
|
||||
},
|
||||
points: []influxdb.Point{
|
||||
{Name: "disk_read", Fields: map[string]interface{}{"disk_read": float64(1)}},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "multi value",
|
||||
points: []influxdb.Point{
|
||||
{Name: "disk_read", Fields: map[string]interface{}{"disk_read": float64(1)}},
|
||||
{Name: "disk_write", Fields: map[string]interface{}{"disk_write": float64(5)}},
|
||||
},
|
||||
packet: gollectd.Packet{
|
||||
Plugin: "disk",
|
||||
Values: []gollectd.Value{
|
||||
|
@ -233,16 +229,13 @@ func TestUnmarshal_Points(t *testing.T) {
|
|||
{Name: "write", Value: 5},
|
||||
},
|
||||
},
|
||||
points: []influxdb.Point{
|
||||
{Name: "disk_read", Fields: map[string]interface{}{"disk_read": float64(1)}},
|
||||
{Name: "disk_write", Fields: map[string]interface{}{"disk_write": float64(5)}},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "tags",
|
||||
points: []influxdb.Point{
|
||||
{
|
||||
Name: "disk_read",
|
||||
Tags: map[string]string{"host": "server01", "instance": "sdk", "type": "disk_octets", "type_instance": "single"},
|
||||
Fields: map[string]interface{}{"disk_read": float64(1)},
|
||||
},
|
||||
},
|
||||
packet: gollectd.Packet{
|
||||
Plugin: "disk",
|
||||
Hostname: "server01",
|
||||
|
@ -253,6 +246,13 @@ func TestUnmarshal_Points(t *testing.T) {
|
|||
{Name: "read", Value: 1},
|
||||
},
|
||||
},
|
||||
points: []influxdb.Point{
|
||||
{
|
||||
Name: "disk_read",
|
||||
Tags: map[string]string{"host": "server01", "instance": "sdk", "type": "disk_octets", "type_instance": "single"},
|
||||
Fields: map[string]interface{}{"disk_read": float64(1)},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue