Skip to content

Commit

Permalink
Changed StoreDataType from string to int
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Jung <[email protected]>
  • Loading branch information
justinjung04 committed Jun 6, 2024
1 parent c798438 commit e4c62c8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 11 additions & 9 deletions pkg/store/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,16 @@ import (
"github.com/thanos-io/thanos/pkg/tracing"
)

type StoreDataType string
type StoreDataType int

const (
PostingsFetched StoreDataType = iota
PostingsTouched
SeriesFetched
SeriesTouched
ChunksFetched
ChunksTouched
)

const (
// MaxSamplesPerChunk is approximately the max number of samples that we may have in any given chunk. This is needed
Expand Down Expand Up @@ -107,14 +116,7 @@ const (
enableChunkHashCalculation = true

// SeriesBatchSize is the default batch size when fetching series from object storage.
SeriesBatchSize = 10000

PostingsFetched StoreDataType = "PostingsFetched"
PostingsTouched StoreDataType = "PostingsTouched"
SeriesFetched StoreDataType = "SeriesFetched"
SeriesTouched StoreDataType = "SeriesTouched"
ChunksFetched StoreDataType = "ChunksFetched"
ChunksTouched StoreDataType = "ChunksTouched"
SeriesBatchSize = 1000
)

var (
Expand Down
2 changes: 1 addition & 1 deletion pkg/store/limiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func NewLimiter(limit uint64, ctr prometheus.Counter) *Limiter {

// Reserve implements ChunksLimiter.
func (l *Limiter) Reserve(num uint64) error {
return l.ReserveWithType(num, "")
return l.ReserveWithType(num, 0)
}

func (l *Limiter) ReserveWithType(num uint64, _ StoreDataType) error {
Expand Down

0 comments on commit e4c62c8

Please sign in to comment.