InfluxDB: Use json-iterator package for json operations (#88562)

* return error early

* enable gzip between grafana and influxdb

* use json-iterator package for json operations

* revert gzip changes

* update test

* go mod tidy
go work sync
This commit is contained in:
ismail simsek
2024-06-06 20:14:53 +03:00
committed by GitHub
parent e21d357d67
commit 808cf75ff8
5 changed files with 39 additions and 27 deletions
@@ -380,10 +380,11 @@ func TestInfluxdbResponseParser(t *testing.T) {
}
})
t.Run("Influxdb response parser parseTimestamp valid JSON.number", func(t *testing.T) {
t.Run("Influxdb response parser parseTimestamp valid number", func(t *testing.T) {
// currently we use milliseconds-precision with influxdb, so the test works with that.
// if we change this to for example nanoseconds-precision, the tests will have to change.
timestamp, err := util.ParseTimestamp(json.Number("1609556645000"))
ts := float64(1609556645000)
timestamp, err := util.ParseTimestamp(ts)
require.NoError(t, err)
require.Equal(t, timestamp.Format(time.RFC3339), "2021-01-02T03:04:05Z")
})