Skip to content

Commit 1f7ad96

Browse files
committed
introducing a new method is DiskStatsReporter which returns the bytes
written at index time
1 parent cb771b1 commit 1f7ad96

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

segment.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,17 @@ type PostingsIterator interface {
101101
Size() int
102102
}
103103

104-
// This flag controls the IO stats collection from the segment files
105-
// during indexing and querying
106-
var CollectIOStats bool
107-
108104
type DiskStatsReporter interface {
105+
// BytesRead returns the bytes read from the disk as
106+
// part of the current running query.
109107
BytesRead() uint64
110-
SetBytesRead(uint64)
108+
// ResetBytesRead is used by the parent layer
109+
// to reset the bytes read value to a consistent
110+
// value during operations such as merging of segments.
111+
ResetBytesRead(uint64)
112+
// BytesRead returns the bytes written to disk while
113+
// building an index
114+
BytesWritten() uint64
111115
}
112116

113117
type OptimizablePostingsIterator interface {

0 commit comments

Comments
 (0)