Skip to content

Commit

Permalink
MB-60914: Zap field specific metrics (#38)
Browse files Browse the repository at this point in the history
 - Added a new interface called FieldStatsReporter which has a
function called UpdateFieldStats
 - This function is expected to be implemented by SegmentBase and
can be called after it is created to populate a map with field stats
 - Currently this is called after merge to find out the number of
vectors in the newly created segment
  • Loading branch information
Likith101 authored Mar 18, 2024
1 parent 7132e29 commit b972537
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions segment.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,13 @@ type DocVisitState interface {
type StatsReporter interface {
ReportBytesWritten(bytesWritten uint64)
}

type FieldStatsReporter interface {
UpdateFieldStats(FieldStats)
}

type FieldStats interface {
Store(statName, fieldName string, value uint64)
Aggregate(stats FieldStats)
Fetch() map[string]map[string]uint64
}

0 comments on commit b972537

Please sign in to comment.