Provide prototype of storage layer interfaces.

This commit is contained in:
Matt T. Proud 2012-12-12 12:13:27 +01:00
parent 6589fc92f8
commit 59a708f25a
2 changed files with 20 additions and 8 deletions

View File

@ -51,12 +51,24 @@ type Sample struct {
Timestamp time.Time
}
type Samples struct {
type SamplePair struct {
Value SampleValue
Timestamp time.Time
}
type SampleSet struct {
Metric Metric
Values []SamplePair
}
type Interval struct {
OldestInclusive time.Time
NewestInclusive time.Time
}
// PENDING DELETION BELOW THIS LINE
type Samples struct {
Value SampleValue
Timestamp time.Time
}

View File

@ -37,14 +37,14 @@ type MetricPersistence interface {
GetMetricForFingerprint(f *model.Fingerprint) (*model.Metric, error)
GetFirstValue(m *model.Metric) (*model.Sample, error)
GetCurrentValue(m *model.Metric) (*model.Sample, error)
GetBoundaryValues(m *model.Metric, i *model.Interval) (*model.SampleSet, error)
GetRangeValues(m *model.Metric, i *model.Interval) (*model.SampleSet, error)
// DIAGNOSTIC FUNCTIONS PENDING DELETION BELOW HERE
GetAllLabelNames() ([]string, error)
GetAllLabelPairs() ([]model.LabelSet, error)
GetAllMetrics() ([]model.LabelSet, error)
// // BEGIN QUERY PRIMITIVES
//
// GetMetricValuesForIntervals(metric, interval) (values ...)
// GetMetricValueLast()
// // END QUERY PRIMITIVES
}