tsdbutil

package
v0.311.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 15 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateTestCustomBucketsFloatHistogram added in v0.54.0

func GenerateTestCustomBucketsFloatHistogram(i int64) *histogram.FloatHistogram

func GenerateTestCustomBucketsFloatHistograms added in v0.302.0

func GenerateTestCustomBucketsFloatHistograms(n int) (r []*histogram.FloatHistogram)

func GenerateTestCustomBucketsHistogram added in v0.54.0

func GenerateTestCustomBucketsHistogram(i int64) *histogram.Histogram

func GenerateTestCustomBucketsHistograms added in v0.302.0

func GenerateTestCustomBucketsHistograms(n int) (r []*histogram.Histogram)

func GenerateTestFloatHistogram added in v0.43.0

func GenerateTestFloatHistogram(i int64) *histogram.FloatHistogram

GenerateTestFloatHistogram but it is up to the user to set any known counter reset hint.

func GenerateTestFloatHistograms added in v0.43.0

func GenerateTestFloatHistograms(n int) (r []*histogram.FloatHistogram)

func GenerateTestGaugeFloatHistogram added in v0.43.0

func GenerateTestGaugeFloatHistogram(i int64) *histogram.FloatHistogram

func GenerateTestGaugeFloatHistograms added in v0.43.0

func GenerateTestGaugeFloatHistograms(n int) (r []*histogram.FloatHistogram)

func GenerateTestGaugeHistogram added in v0.43.0

func GenerateTestGaugeHistogram(i int64) *histogram.Histogram

func GenerateTestGaugeHistograms added in v0.43.0

func GenerateTestGaugeHistograms(n int) (r []*histogram.Histogram)

func GenerateTestHistogram added in v0.43.0

func GenerateTestHistogram(i int64) *histogram.Histogram

GenerateTestHistogram but it is up to the user to set any known counter reset hint.

func GenerateTestHistogramWithHint added in v0.54.1

func GenerateTestHistogramWithHint(n int, hint histogram.CounterResetHint) *histogram.Histogram

func GenerateTestHistograms added in v0.43.0

func GenerateTestHistograms(n int) (r []*histogram.Histogram)

func RemoveTmpDirs added in v0.311.0

func RemoveTmpDirs(l *slog.Logger, dir string, isTmpDir func(fi fs.DirEntry) bool) error

RemoveTmpDirs attempts to remove directories in the specified directory which match the isTmpDir predicate. Errors encountered during reading the directory that other than non-existence are returned. All other errors encountered during removal of tmp directories are logged but do not cause early termination.

func SetFloatHistogramCounterReset added in v0.49.0

func SetFloatHistogramCounterReset(h *histogram.FloatHistogram) *histogram.FloatHistogram

func SetFloatHistogramNotCounterReset added in v0.45.0

func SetFloatHistogramNotCounterReset(h *histogram.FloatHistogram) *histogram.FloatHistogram

func SetHistogramCounterReset added in v0.49.0

func SetHistogramCounterReset(h *histogram.Histogram) *histogram.Histogram

func SetHistogramNotCounterReset added in v0.45.0

func SetHistogramNotCounterReset(h *histogram.Histogram) *histogram.Histogram

func TestDirLockerUsage

func TestDirLockerUsage(t *testing.T, open func(t *testing.T, data string, createLock bool) (*DirLocker, testutil.Closer))

TestDirLockerUsage performs a set of tests which guarantee correct usage of DirLocker. open should use data as the storage directory, and createLock to determine if a lock file should be used.

Types

type DirLocker

type DirLocker struct {
	// contains filtered or unexported fields
}

func NewDirLocker

func NewDirLocker(dir, subsystem string, l *slog.Logger, r prometheus.Registerer) (*DirLocker, error)

NewDirLocker creates a DirLocker that can obtain an exclusive lock on dir.

func (*DirLocker) Lock

func (l *DirLocker) Lock() error

Lock obtains the lock on the locker directory.

func (*DirLocker) Release

func (l *DirLocker) Release() error

Release releases the lock. No-op if the lock is not held.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL