Skip to content

Commit

Permalink
Increase flush threshold to 5MB
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonip committed Dec 16, 2024
1 parent 7d2618d commit 79e32c0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions x-pack/apm-server/sampling/eventstoragepebble/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const (
entryMetaTraceSampled byte = 's'
entryMetaTraceUnsampled byte = 'u'
entryMetaTraceEvent byte = 'e'

flushThreshold = 5 * 1024 * 1024
)

// Storage provides storage for sampled transactions and spans,
Expand Down Expand Up @@ -160,7 +162,7 @@ func (rw *ReadWriter) writeEntry(key, data []byte) error {
return err
}

if rw.batch.Len() > 1<<20 {
if rw.batch.Len() > flushThreshold {
if err := rw.Flush(); err != nil {
return err
}
Expand Down Expand Up @@ -200,7 +202,7 @@ func (rw *ReadWriter) DeleteTraceEvent(traceID, id string) error {
if err != nil {
return err
}
if rw.batch.Len() > 1<<20 {
if rw.batch.Len() > flushThreshold {
if err := rw.Flush(); err != nil {
return err
}
Expand Down

0 comments on commit 79e32c0

Please sign in to comment.