mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 06:04:05 -08:00
Add several needed persistence proxy methods to tiered storage.
This commit is contained in:
parent
081d250929
commit
3c9d6cb66c
|
@ -62,6 +62,11 @@ type Storage interface {
|
|||
Drain()
|
||||
Flush()
|
||||
Close()
|
||||
|
||||
// MetricPersistence proxy methods.
|
||||
GetAllMetricNames() ([]string, error)
|
||||
GetFingerprintsForLabelSet(model.LabelSet) (model.Fingerprints, error)
|
||||
GetMetricForFingerprint(model.Fingerprint) (m *model.Metric, err error)
|
||||
}
|
||||
|
||||
func NewTieredStorage(appendToMemoryQueueDepth, appendToDiskQueueDepth, viewQueueDepth uint, flushMemoryInterval, writeMemoryInterval, memoryTTL time.Duration, root string) Storage {
|
||||
|
@ -520,3 +525,18 @@ func (t *tieredStorage) loadChunkAroundTime(iterator *levigo.Iterator, frontier
|
|||
|
||||
return
|
||||
}
|
||||
|
||||
func (t *tieredStorage) GetAllMetricNames() ([]string, error) {
|
||||
// TODO: handle memory persistence as well.
|
||||
return t.diskStorage.GetAllMetricNames()
|
||||
}
|
||||
|
||||
func (t *tieredStorage) GetFingerprintsForLabelSet(labelSet model.LabelSet) (model.Fingerprints, error) {
|
||||
// TODO: handle memory persistence as well.
|
||||
return t.diskStorage.GetFingerprintsForLabelSet(labelSet)
|
||||
}
|
||||
|
||||
func (t *tieredStorage) GetMetricForFingerprint(f model.Fingerprint) (m *model.Metric, err error) {
|
||||
// TODO: handle memory persistence as well.
|
||||
return t.diskStorage.GetMetricForFingerprint(f)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue