From ecbc79e7e31dd707f0b44f57f323637f03b747ec Mon Sep 17 00:00:00 2001 From: Paul Dix Date: Tue, 8 Sep 2015 19:37:33 -0700 Subject: [PATCH] Fix disksize to work with new WAL --- tsdb/engine/wal/wal.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/tsdb/engine/wal/wal.go b/tsdb/engine/wal/wal.go index 40934cb766..857908d43b 100644 --- a/tsdb/engine/wal/wal.go +++ b/tsdb/engine/wal/wal.go @@ -211,15 +211,12 @@ func (l *Log) Open() error { func (l *Log) DiskSize() (int64, error) { l.mu.RLock() defer l.mu.RUnlock() - var size int64 - for _, partition := range l.partitions { - stat, err := os.Stat(partition.path) - if err != nil { - return 0, err - } - size += stat.Size() + + stat, err := os.Stat(l.path) + if err != nil { + return 0, err } - return size, nil + return stat.Size(), nil } // Cursor will return a cursor object to Seek and iterate with Next for the WAL cache for the given