Refactor InfluxDB listener (#6974)
Use streaming parser in InfluxDB listener
This commit is contained in:
@@ -13,7 +13,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
var TimeFunc = func() time.Time {
|
||||
var testTimeFunc = func() time.Time {
|
||||
return time.Unix(0, 0)
|
||||
}
|
||||
|
||||
@@ -528,7 +528,7 @@ func TestDropWizard(t *testing.T) {
|
||||
map[string]interface{}{
|
||||
"value": 42.0,
|
||||
},
|
||||
TimeFunc(),
|
||||
testTimeFunc(),
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -547,7 +547,7 @@ func TestDropWizard(t *testing.T) {
|
||||
map[string]interface{}{
|
||||
"value": 42.0,
|
||||
},
|
||||
TimeFunc(),
|
||||
testTimeFunc(),
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -573,7 +573,7 @@ func TestDropWizard(t *testing.T) {
|
||||
map[string]interface{}{
|
||||
"value": 42.0,
|
||||
},
|
||||
TimeFunc(),
|
||||
testTimeFunc(),
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -584,7 +584,7 @@ func TestDropWizard(t *testing.T) {
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
parser := NewParser()
|
||||
parser.SetTimeFunc(TimeFunc)
|
||||
parser.SetTimeFunc(testTimeFunc)
|
||||
metrics, err := parser.Parse(tt.input)
|
||||
tt.errFunc(t, err)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user