Browse Source

TSDB: move function only used in tests

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
pull/13764/head
Bryan Boreham 8 months ago
parent
commit
d45b5deb75
  1. 16
      tsdb/block_test.go
  2. 17
      tsdb/db.go

16
tsdb/block_test.go

@ -209,6 +209,22 @@ func TestCorruptedChunk(t *testing.T) {
}
}
func sequenceFiles(dir string) ([]string, error) {
files, err := os.ReadDir(dir)
if err != nil {
return nil, err
}
var res []string
for _, fi := range files {
if _, err := strconv.ParseUint(fi.Name(), 10, 64); err != nil {
continue
}
res = append(res, filepath.Join(dir, fi.Name()))
}
return res, nil
}
func TestLabelValuesWithMatchers(t *testing.T) {
tmpdir := t.TempDir()
ctx := context.Background()

17
tsdb/db.go

@ -24,7 +24,6 @@ import (
"os"
"path/filepath"
"slices"
"strconv"
"strings"
"sync"
"time"
@ -2209,22 +2208,6 @@ func blockDirs(dir string) ([]string, error) {
return dirs, nil
}
func sequenceFiles(dir string) ([]string, error) {
files, err := os.ReadDir(dir)
if err != nil {
return nil, err
}
var res []string
for _, fi := range files {
if _, err := strconv.ParseUint(fi.Name(), 10, 64); err != nil {
continue
}
res = append(res, filepath.Join(dir, fi.Name()))
}
return res, nil
}
func exponential(d, min, max time.Duration) time.Duration {
d *= 2
if d < min {

Loading…
Cancel
Save