Skip to content

Commit

Permalink
log gc sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
brianolson committed Nov 15, 2024
1 parent 9780691 commit 766dc86
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion events/pebblepersist.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,18 @@ func (pp *PebblePersist) GarbageCollect(ctx context.Context, retention time.Dura
break
}
}
sizeBefore, _ := pp.db.EstimateDiskUsage(nil, nil)
if seq == -1 {
// nothing to delete
return nil
}
var key [16]byte
setKeySeqMillis(key[:], seq, lastKeyTime)
err = pp.db.DeleteRange(zeroKey[:], key[:], pebble.Sync)
return err
if err != nil {
return err
}
sizeAfter, _ := pp.db.EstimateDiskUsage(nil, nil)
log.Infow("pebble gc", "before", sizeBefore, "after", sizeAfter)
return nil
}

0 comments on commit 766dc86

Please sign in to comment.