Skip to content

Commit

Permalink
Fixing linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-stanaka committed Sep 20, 2022
1 parent 3c399f1 commit 459a21f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pkg/store/bucket.go
Expand Up @@ -9,7 +9,6 @@ import (
"context"
"encoding/binary"
"fmt"
"github.com/cespare/xxhash"
"io"
"math"
"os"
Expand All @@ -20,6 +19,8 @@ import (
"sync"
"time"

"github.com/cespare/xxhash"

"github.com/alecthomas/units"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
Expand Down
3 changes: 2 additions & 1 deletion pkg/store/bucket_test.go
Expand Up @@ -8,7 +8,6 @@ import (
"context"
"encoding/binary"
"fmt"
"github.com/cespare/xxhash"
"io"
"math"
"math/rand"
Expand All @@ -23,6 +22,8 @@ import (
"testing"
"time"

"github.com/cespare/xxhash"

"github.com/go-kit/log"
"github.com/gogo/protobuf/proto"
"github.com/gogo/protobuf/types"
Expand Down
5 changes: 4 additions & 1 deletion pkg/store/prometheus.go
Expand Up @@ -15,6 +15,8 @@ import (
"strings"
"sync"

"github.com/cespare/xxhash"

"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/model/timestamp"

Expand Down Expand Up @@ -412,6 +414,7 @@ func (p *PrometheusStore) handleStreamedPrometheusResponse(
// has one difference. Prometheus has Chunk_UNKNOWN Chunk_Encoding = 0 vs we start from
// XOR as 0. Compensate for that here:
Type: storepb.Chunk_Encoding(chk.Type - 1),
Hash: xxhash.Sum64(chk.Data),
},
}
seriesStats.Samples += thanosChks[i].Raw.XORNumSamples()
Expand Down Expand Up @@ -512,7 +515,7 @@ func (p *PrometheusStore) chunkSamples(series *prompb.TimeSeries, maxSamplesPerC
chks = append(chks, storepb.AggrChunk{
MinTime: samples[0].Timestamp,
MaxTime: samples[chunkSize-1].Timestamp,
Raw: &storepb.Chunk{Type: enc, Data: cb},
Raw: &storepb.Chunk{Type: enc, Data: cb, Hash: xxhash.Sum64(cb)},
})

samples = samples[chunkSize:]
Expand Down

0 comments on commit 459a21f

Please sign in to comment.