Skip to content

Commit

Permalink
Show the number of dropped segments (#210)
Browse files Browse the repository at this point in the history
Signed-off-by: bigsheeper <[email protected]>
  • Loading branch information
bigsheeper authored Nov 8, 2023
1 parent c66effc commit 700564d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions states/etcd/show/segment.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (c *ComponentShow) SegmentCommand(ctx context.Context, p *SegmentParam) err
totalRC := int64(0)
healthy := 0
var statslogSize int64
var growing, sealed, flushed int
var growing, sealed, flushed, dropped int
fieldSize := make(map[int64]int64)
for _, info := range segments {

Expand All @@ -53,6 +53,8 @@ func (c *ComponentShow) SegmentCommand(ctx context.Context, p *SegmentParam) err
sealed++
case models.SegmentStateFlushing, models.SegmentStateFlushed:
flushed++
case models.SegmentStateDropped:
dropped++
}

switch p.Format {
Expand Down Expand Up @@ -87,7 +89,7 @@ func (c *ComponentShow) SegmentCommand(ctx context.Context, p *SegmentParam) err
fmt.Printf("--- Total statslog size: %s\n", hrSize(statslogSize))
}

fmt.Printf("--- Growing: %d, Sealed: %d, Flushed: %d\n", growing, sealed, flushed)
fmt.Printf("--- Growing: %d, Sealed: %d, Flushed: %d, Dropped: %d\n", growing, sealed, flushed, dropped)
fmt.Printf("--- Total Segments: %d, row count: %d\n", healthy, totalRC)
return nil
}
Expand Down

0 comments on commit 700564d

Please sign in to comment.