Documentation ¶
Index ¶
- func ChunkFromSamples(s []Sample) chunks.Meta
- func ChunkFromSamplesGeneric(s Samples) chunks.Meta
- func GenerateTestFloatHistogram(i int) *histogram.FloatHistogram
- func GenerateTestFloatHistograms(n int) (r []*histogram.FloatHistogram)
- func GenerateTestGaugeFloatHistogram(i int) *histogram.FloatHistogram
- func GenerateTestGaugeFloatHistograms(n int) (r []*histogram.FloatHistogram)
- func GenerateTestGaugeHistogram(i int) *histogram.Histogram
- func GenerateTestGaugeHistograms(n int) (r []*histogram.Histogram)
- func GenerateTestHistogram(i int) *histogram.Histogram
- func GenerateTestHistograms(n int) (r []*histogram.Histogram)
- func PopulatedChunk(numSamples int, minTime int64) chunks.Meta
- func SetFloatHistogramNotCounterReset(h *histogram.FloatHistogram) *histogram.FloatHistogram
- func SetHistogramNotCounterReset(h *histogram.Histogram) *histogram.Histogram
- func TestDirLockerUsage(t *testing.T, ...)
- type DirLocker
- type Sample
- type SampleSlice
- type Samples
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChunkFromSamples ¶
ChunkFromSamples requires all samples to have the same type.
func ChunkFromSamplesGeneric ¶
ChunkFromSamplesGeneric requires all samples to have the same type.
func GenerateTestFloatHistogram ¶ added in v0.43.0
func GenerateTestFloatHistogram(i int) *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 int) *histogram.FloatHistogram
func GenerateTestGaugeFloatHistograms ¶ added in v0.43.0
func GenerateTestGaugeFloatHistograms(n int) (r []*histogram.FloatHistogram)
func GenerateTestGaugeHistogram ¶ added in v0.43.0
func GenerateTestGaugeHistograms ¶ added in v0.43.0
func GenerateTestHistogram ¶ added in v0.43.0
GenerateTestHistogram but it is up to the user to set any known counter reset hint.
func GenerateTestHistograms ¶ added in v0.43.0
func PopulatedChunk ¶
PopulatedChunk creates a chunk populated with samples every second starting at minTime
func SetFloatHistogramNotCounterReset ¶ added in v0.45.0
func SetFloatHistogramNotCounterReset(h *histogram.FloatHistogram) *histogram.FloatHistogram
func SetHistogramNotCounterReset ¶ added in v0.45.0
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 log.Logger, r prometheus.Registerer) (*DirLocker, error)
NewDirLocker creates a DirLocker that can obtain an exclusive lock on dir.
type Sample ¶
type Sample interface { T() int64 F() float64 H() *histogram.Histogram FH() *histogram.FloatHistogram Type() chunkenc.ValueType }
func GenerateSamples ¶
GenerateSamples starting at start and counting up numSamples.
type SampleSlice ¶
type SampleSlice []Sample
func (SampleSlice) Get ¶
func (s SampleSlice) Get(i int) Sample
func (SampleSlice) Len ¶
func (s SampleSlice) Len() int