MCPcopy
hub / github.com/grafana/tempo / compactionLoop

Method compactionLoop

tempodb/compactor.go:75–87  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

73)
74
75func (rw *readerWriter) compactionLoop(ctx context.Context) {
76 compactionCycle := DefaultCompactionCycle
77 if rw.compactorCfg.CompactionCycle > 0 {
78 compactionCycle = rw.compactorCfg.CompactionCycle
79 }
80
81 // Keep going until the context is cancelled, which means we're shutting down and need to stop compacting
82 for ctx.Err() == nil {
83 doForAtLeast(ctx, compactionCycle, func() {
84 rw.compactOneTenant(ctx)
85 })
86 }
87}
88
89// compactOneTenant runs a compaction cycle every 30s
90func (rw *readerWriter) compactOneTenant(ctx context.Context) {

Callers 1

EnableCompactionMethod · 0.95

Calls 2

compactOneTenantMethod · 0.95
doForAtLeastFunction · 0.85

Tested by

no test coverage detected