Skip to content

feat: add consumeDelaySeconds for time-based consumer delay#458

Open
coderzc wants to merge 1 commit intoopenmessaging:masterfrom
coderzc:feat/pause-duration-seconds
Open

feat: add consumeDelaySeconds for time-based consumer delay#458
coderzc wants to merge 1 commit intoopenmessaging:masterfrom
coderzc:feat/pause-duration-seconds

Conversation

@coderzc
Copy link
Copy Markdown

@coderzc coderzc commented Apr 28, 2026

Summary

  • Adds a consumeDelaySeconds field to Workload. When > 0, the framework automatically pauses all consumers immediately after warmup, sleeps for the configured number of seconds, then resumes consumers before the measurement window begins.
  • Enables tiered-storage style scenarios where backlog must accumulate and (for Pulsar) be offloaded before consumers start draining, without requiring an external coordinator.

Motivation

consumerBacklogSizeGB builds backlog by size, but for tiered-storage benchmarks we need a time-based gap so the broker has a deterministic window to flush ledgers and offload them. A simple time-based delay that the framework owns end-to-end is the cleanest expression of that.

Behavior

  • Default value 0 ⇒ no behavior change for existing workloads.
  • When > 0, after warmupDurationMinutes and worker.resetStats(), worker.pauseConsumers() is called, the thread sleeps for consumeDelaySeconds, then worker.resumeConsumers() is called before the measurement loop starts.
  • Targets a different scenario from consumerBacklogSizeGB; if both are set the existing backlog logic still runs and the consume-delay window happens before the measurement loop.

Test plan

  • mvn -pl benchmark-framework -am clean compile passes (verified locally).
  • Existing workloads without consumeDelaySeconds are unaffected.
  • A workload with consumeDelaySeconds: 60 pauses consumers for 60s after warmup, then resumes.

Introduces a workload-level consumeDelaySeconds option. When set, after
warmup the framework pauses all consumers for the configured number of
seconds and then automatically resumes them before the measurement
window starts.

This enables tiered-storage style scenarios where backlog must
accumulate and be offloaded before consumers begin draining, without
requiring an external coordinator.
@coderzc coderzc force-pushed the feat/pause-duration-seconds branch from c7f344e to 35dd2ea Compare April 28, 2026 03:41
@coderzc coderzc changed the title feat: add pauseDurationSeconds for time-based consumer pause feat: add consumeDelaySeconds for time-based consumer delay Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant