Class WorkloadReport

java.lang.Object
org.acemq.workloads.WorkloadReport

public final class WorkloadReport extends Object
What one run measured, and what the rules made of it.

Read isValid() before anything else. A report whose run did not offer the load it was configured for, or whose broker was blocked by a resource alarm for half the time, still has a full set of numbers — and those numbers describe the client or the alarm rather than the broker.

  • Method Details

    • spec

      public Workload spec()
    • samples

      public List<Sample> samples()
      What the run looked like as it went, one entry per sampling interval.

      Everything else here is one number for the whole window, which is the right shape for "how fast is this broker" and the wrong one for "what happened at 14:02". A run whose p99 is 40ms throughout and one that idles at 3ms and spends twelve seconds at 900ms have the same aggregate; only the first is healthy, and only this tells them apart.

      The engine has always emitted these to a RunListener during the run. They were not kept, so anything reading a report afterwards — a pipeline, a dashboard, another tool correlating this against its own timeline — could not see them. Keeping them costs one entry per interval and makes the report answer a question it could not answer before.

      Empty for a run that ended before the first interval elapsed.

      Returns:
      the samples, oldest first, never null
    • name

      public String name()
    • startedAt

      public Instant startedAt()
    • duration

      public Duration duration()
      Returns:
      the measured window, which excludes warm-up
    • published

      public long published()
      Returns:
      how many messages were handed to the broker
    • confirmed

      public long confirmed()
      Returns:
      how many the broker confirmed. Equal to published() when confirms are off
    • failed

      public long failed()
      Returns:
      how many publishes were refused or errored
    • consumed

      public long consumed()
      Returns:
      how many messages the consumers processed
    • offeredRate

      public long offeredRate()
      Returns:
      the rate the workload was configured to offer, or 0 when unthrottled
    • achievedPublishRate

      public double achievedPublishRate()
      Returns:
      messages published per second over the measured window
    • consumeRate

      public double consumeRate()
      Returns:
      messages consumed per second over the measured window
    • endToEnd

      public LatencySummary endToEnd()
      Returns:
      latency from when each message was due to when a consumer received it. Empty when the workload had no consumers
    • publishLatency

      public LatencySummary publishLatency()
      Returns:
      how long the publish call itself took, including the confirm when they are on
    • sendLag

      public LatencySummary sendLag()
      Returns:
      how far behind its own schedule each publish went out. This is the measurement that says whether the configured rate was actually offered, and a large value here invalidates every other number in the report
    • queueDepthAtEnd

      public Optional<Long> queueDepthAtEnd()
      Returns:
      the queue's depth when the run finished, if it could be read
    • wasBlocked

      public boolean wasBlocked()
      Returns:
      whether the connection was ever blocked by a broker resource alarm
    • blockedNanos

      public long blockedNanos()
      Returns:
      how long the connection spent blocked
    • blockedReason

      public Optional<String> blockedReason()
    • consumersEnabled

      public boolean consumersEnabled()
    • findings

      public List<Finding> findings()
      Returns:
      everything the rules noticed, worst first
    • isValid

      public boolean isValid()
      Returns:
      whether this run measured what it set out to measure. False when a rule returned Severity.INVALID — the numbers are still here, and no conclusion may be drawn from them
    • passed

      public boolean passed()
      Returns:
      whether the run is valid and nothing failed. An invalid run never passes, because a measurement of the wrong thing cannot meet an objective about the right one
    • problems

      public List<Finding> problems()
      Returns:
      the findings that failed or invalidated the run
    • format

      public String format()
      Returns:
      the whole report, formatted for a terminal
    • toString

      public String toString()
      Overrides:
      toString in class Object