diff --git a/plugins/inputs/bind/bind_test.go b/plugins/inputs/bind/bind_test.go index b961d549d..40c32aee3 100644 --- a/plugins/inputs/bind/bind_test.go +++ b/plugins/inputs/bind/bind_test.go @@ -7,7 +7,6 @@ import ( "testing" "github.com/influxdata/telegraf/testutil" - "github.com/stretchr/testify/assert" ) @@ -127,20 +126,19 @@ func TestBindJsonStats(t *testing.T) { } fields := map[string]interface{}{ - "block_size": 13893632, - "context_size": 3685480, - "in_use": 3064368, - "lost": 0, - "total_use": 18206566, + "block_size": int64(13893632), + "context_size": int64(3685480), + "in_use": int64(3064368), + "lost": int64(0), + "total_use": int64(18206566), } - acc.AssertContainsTaggedFields(t, "bind_memory", fields, tags) }) // Subtest for per-context memory stats t.Run("memory_context", func(t *testing.T) { - assert.True(t, acc.HasIntField("bind_memory_context", "total")) - assert.True(t, acc.HasIntField("bind_memory_context", "in_use")) + assert.True(t, acc.HasInt64Field("bind_memory_context", "total")) + assert.True(t, acc.HasInt64Field("bind_memory_context", "in_use")) }) } @@ -329,11 +327,11 @@ func TestBindXmlStatsV2(t *testing.T) { } fields := map[string]interface{}{ - "block_size": 77070336, - "context_size": 6663840, - "in_use": 20772579, - "lost": 0, - "total_use": 81804609, + "block_size": int64(77070336), + "context_size": int64(6663840), + "in_use": int64(20772579), + "lost": int64(0), + "total_use": int64(81804609), } acc.AssertContainsTaggedFields(t, "bind_memory", fields, tags) @@ -341,8 +339,8 @@ func TestBindXmlStatsV2(t *testing.T) { // Subtest for per-context memory stats t.Run("memory_context", func(t *testing.T) { - assert.True(t, acc.HasIntField("bind_memory_context", "total")) - assert.True(t, acc.HasIntField("bind_memory_context", "in_use")) + assert.True(t, acc.HasInt64Field("bind_memory_context", "total")) + assert.True(t, acc.HasInt64Field("bind_memory_context", "in_use")) }) } @@ -553,11 +551,11 @@ func TestBindXmlStatsV3(t *testing.T) { } fields := map[string]interface{}{ - "block_size": 45875200, - "context_size": 10037400, - "in_use": 6000232, - "lost": 0, - "total_use": 777821909, + "block_size": int64(45875200), + "context_size": int64(10037400), + "in_use": int64(6000232), + "lost": int64(0), + "total_use": int64(777821909), } acc.AssertContainsTaggedFields(t, "bind_memory", fields, tags) @@ -565,8 +563,8 @@ func TestBindXmlStatsV3(t *testing.T) { // Subtest for per-context memory stats t.Run("memory_context", func(t *testing.T) { - assert.True(t, acc.HasIntField("bind_memory_context", "total")) - assert.True(t, acc.HasIntField("bind_memory_context", "in_use")) + assert.True(t, acc.HasInt64Field("bind_memory_context", "total")) + assert.True(t, acc.HasInt64Field("bind_memory_context", "in_use")) }) } diff --git a/plugins/inputs/bind/json_stats.go b/plugins/inputs/bind/json_stats.go index 95c7e6fe8..cf595c1a3 100644 --- a/plugins/inputs/bind/json_stats.go +++ b/plugins/inputs/bind/json_stats.go @@ -23,16 +23,16 @@ type jsonStats struct { } type jsonMemory struct { - TotalUse int - InUse int - BlockSize int - ContextSize int - Lost int + TotalUse int64 + InUse int64 + BlockSize int64 + ContextSize int64 + Lost int64 Contexts []struct { Id string Name string - Total int - InUse int + Total int64 + InUse int64 } } diff --git a/plugins/inputs/bind/xml_stats_v2.go b/plugins/inputs/bind/xml_stats_v2.go index 45071bdc0..5e17851fb 100644 --- a/plugins/inputs/bind/xml_stats_v2.go +++ b/plugins/inputs/bind/xml_stats_v2.go @@ -44,15 +44,15 @@ type v2Statistics struct { // Omitted nodes: references, maxinuse, blocksize, pools, hiwater, lowater Id string `xml:"id"` Name string `xml:"name"` - Total int `xml:"total"` - InUse int `xml:"inuse"` + Total int64 `xml:"total"` + InUse int64 `xml:"inuse"` } `xml:"contexts>context"` Summary struct { - TotalUse int - InUse int - BlockSize int - ContextSize int - Lost int + TotalUse int64 + InUse int64 + BlockSize int64 + ContextSize int64 + Lost int64 } `xml:"summary"` } `xml:"memory"` } diff --git a/plugins/inputs/bind/xml_stats_v3.go b/plugins/inputs/bind/xml_stats_v3.go index ed2cc1b7f..89e4ea0b8 100644 --- a/plugins/inputs/bind/xml_stats_v3.go +++ b/plugins/inputs/bind/xml_stats_v3.go @@ -27,15 +27,15 @@ type v3Memory struct { // Omitted nodes: references, maxinuse, blocksize, pools, hiwater, lowater Id string `xml:"id"` Name string `xml:"name"` - Total int `xml:"total"` - InUse int `xml:"inuse"` + Total int64 `xml:"total"` + InUse int64 `xml:"inuse"` } `xml:"contexts>context"` Summary struct { - TotalUse int - InUse int - BlockSize int - ContextSize int - Lost int + TotalUse int64 + InUse int64 + BlockSize int64 + ContextSize int64 + Lost int64 } `xml:"summary"` } @@ -53,7 +53,7 @@ type v3View struct { Name string `xml:"name,attr"` RRSets []struct { Name string `xml:"name"` - Value int `xml:"counter"` + Value int64 `xml:"counter"` } `xml:"rrset"` } `xml:"cache"` } @@ -63,7 +63,7 @@ type v3CounterGroup struct { Type string `xml:"type,attr"` Counters []struct { Name string `xml:"name,attr"` - Value int `xml:",chardata"` + Value int64 `xml:",chardata"` } `xml:"counter"` }