Class Workload.Builder
- Enclosing class:
Workload
Workload.-
Method Summary
Modifier and TypeMethodDescriptionbuild()consumers(Consumer<ConsumerSpec> spec) management(String url, String user, String password) The management API, for queue depth and topology facts the AMQP connection cannot see.publishers(Consumer<PublisherSpec> spec) Measure until something stops the run.topology(Consumer<TopologySpec> spec) Runs without the default rules.
-
Method Details
-
topology
- Parameters:
spec- what the messages travel through- Returns:
- this builder
-
publishers
- Parameters:
spec- how the load is offered- Returns:
- this builder
-
consumers
- Parameters:
spec- how the load is consumed- Returns:
- this builder
-
warmup
- Parameters:
warmup- how long to run before measuring anything- Returns:
- this builder
-
runFor
- Parameters:
duration- how long the measured window lasts- Returns:
- this builder
-
runUntilStopped
Measure until something stops the run.For a workload that exists to occupy a broker rather than to answer a question with a number — a generator kept beside a cluster somebody else is experimenting on, a queue that must have consumers on it for as long as the experiment lasts. Such a run has no natural length, and making it guess one is how it ends early: an experiment that outlasts the guess spends its last minutes against a broker nobody is using, which is the condition the workload was there to prevent.
It still measures everything it otherwise would, and the report still describes the window that happened rather than the one that was asked for. Stopping is the only way it ends —
RunHandle.stop(), or SIGTERM on the command line.- Returns:
- this builder
-
expect
- Parameters:
objective- something the result has to satisfy, fromObjective- Returns:
- this builder
-
rule
- Parameters:
rule- an extra check to run against the report- Returns:
- this builder
-
withoutDefaultRules
Runs without the default rules.Worth thinking twice about. The defaults are mostly validity checks, and removing them does not make a run better — it makes a run that silently failed to offer its load look like a successful one.
- Returns:
- this builder
-
management
The management API, for queue depth and topology facts the AMQP connection cannot see.Optional. Without it the report simply omits the queue depth, which is one fewer way to tell a queue that is still draining from messages that were lost.
- Parameters:
url- the management URL, for examplehttp://localhost:15672user- a broker user with the monitoring tagpassword- its password- Returns:
- this builder
-
build
- Returns:
- the workload
-
run
- Parameters:
brokerUrl- an AMQP URL- Returns:
- the report, building and running in one step
-