Skip to content

Commit bb135b8

Browse files
authored
Making stats computed using DiskStatsReporter optional (#17)
* Introduced a flag, which allows IO stats computation when set true * introducing a new method is DiskStatsReporter which returns the bytes written at index time
1 parent bde2377 commit bb135b8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

segment.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,16 @@ type PostingsIterator interface {
102102
}
103103

104104
type DiskStatsReporter interface {
105+
// BytesRead returns the bytes read from the disk as
106+
// part of the current running query.
105107
BytesRead() uint64
106-
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
107115
}
108116

109117
type OptimizablePostingsIterator interface {

0 commit comments

Comments
 (0)