mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
New interface definition after discussion.
This commit is contained in:
parent
59a708f25a
commit
0886592ebc
|
@ -15,8 +15,14 @@ package metric
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/matttproud/prometheus/model"
|
"github.com/matttproud/prometheus/model"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type StalenessPolicy struct {
|
||||||
|
AllowStale bool
|
||||||
|
InterpolationInterval time.Duration
|
||||||
|
}
|
||||||
|
|
||||||
// MetricPersistence is a system for storing metric samples in a persistence
|
// MetricPersistence is a system for storing metric samples in a persistence
|
||||||
// layer.
|
// layer.
|
||||||
type MetricPersistence interface {
|
type MetricPersistence interface {
|
||||||
|
@ -37,10 +43,10 @@ type MetricPersistence interface {
|
||||||
|
|
||||||
GetMetricForFingerprint(f *model.Fingerprint) (*model.Metric, error)
|
GetMetricForFingerprint(f *model.Fingerprint) (*model.Metric, error)
|
||||||
|
|
||||||
GetFirstValue(m *model.Metric) (*model.Sample, error)
|
GetFirstValue(*model.Metric) (*model.Sample, error)
|
||||||
GetCurrentValue(m *model.Metric) (*model.Sample, error)
|
GetValueAtTime(*model.Metric, *time.Time, *StalenessPolicy) (*model.Sample, error)
|
||||||
GetBoundaryValues(m *model.Metric, i *model.Interval) (*model.SampleSet, error)
|
GetBoundaryValues(*model.Metric, *model.Interval, *StalenessPolicy) (*model.Sample, *model.Sample, error)
|
||||||
GetRangeValues(m *model.Metric, i *model.Interval) (*model.SampleSet, error)
|
GetRangeValues(*model.Metric, *model.Interval, *StalenessPolicy) (*model.SampleSet, error)
|
||||||
|
|
||||||
// DIAGNOSTIC FUNCTIONS PENDING DELETION BELOW HERE
|
// DIAGNOSTIC FUNCTIONS PENDING DELETION BELOW HERE
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,9 @@ import (
|
||||||
"github.com/matttproud/prometheus/coding/indexable"
|
"github.com/matttproud/prometheus/coding/indexable"
|
||||||
"github.com/matttproud/prometheus/model"
|
"github.com/matttproud/prometheus/model"
|
||||||
dto "github.com/matttproud/prometheus/model/generated"
|
dto "github.com/matttproud/prometheus/model/generated"
|
||||||
|
"github.com/matttproud/prometheus/storage/metric"
|
||||||
"log"
|
"log"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (l *LevelDBMetricPersistence) hasIndexMetric(dto *dto.Metric) (bool, error) {
|
func (l *LevelDBMetricPersistence) hasIndexMetric(dto *dto.Metric) (bool, error) {
|
||||||
|
@ -198,3 +200,19 @@ func (l *LevelDBMetricPersistence) GetMetricForFingerprint(f *model.Fingerprint)
|
||||||
|
|
||||||
panic("unreachable")
|
panic("unreachable")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (l *LevelDBMetricPersistence) GetBoundaryValues(m *model.Metric, i *model.Interval, s *metric.StalenessPolicy) (*model.Sample, *model.Sample, error) {
|
||||||
|
panic("not implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *LevelDBMetricPersistence) GetFirstValue(m *model.Metric) (*model.Sample, error) {
|
||||||
|
panic("not implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *LevelDBMetricPersistence) GetValueAtTime(m *model.Metric, t *time.Time, s *metric.StalenessPolicy) (*model.Sample, error) {
|
||||||
|
panic("not implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *LevelDBMetricPersistence) GetRangeValues(m *model.Metric, i *model.Interval, s *metric.StalenessPolicy) (*model.SampleSet, error) {
|
||||||
|
panic("not implemented")
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue