mirror of
https://github.com/prometheus/prometheus.git
synced 2026-05-28 04:02:21 -04:00
Make DB blocks list public.
This enable computing the first timestamp in the DB only accessing public interfaces. Signed-off-by: Thibault Chataigner <t.chataigner@criteo.com>
This commit is contained in:
parent
5fa1c993b9
commit
5ca18837e9
1 changed files with 7 additions and 0 deletions
7
db.go
7
db.go
|
|
@ -520,6 +520,13 @@ func validateBlockSequence(bs []DiskBlock) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (db *DB) Blocks() []DiskBlock {
|
||||
db.mtx.RLock()
|
||||
defer db.mtx.RUnlock()
|
||||
|
||||
return db.blocks
|
||||
}
|
||||
|
||||
// Close the partition.
|
||||
func (db *DB) Close() error {
|
||||
close(db.stopc)
|
||||
|
|
|
|||
Loading…
Reference in a new issue