Record Class SweepProgressEvent

java.lang.Object
java.lang.Record
com.qtsurfer.api.sdk.SweepProgressEvent
Record Components:
stage - current workflow stage
percent - 0-100, computed from the runs finished out of the runs expected (done/total on the snapshot, both run-level counts — not the shard counts, which partition units of work rather than runs). null on stage transitions before the first poll
coverageRatio - fraction (0-1) of the requested window that actually holds data, as reported once preparation completes. Non-null only on the final BacktestStage.PREPARING event. Worth reading on a sweep in particular: a thinly covered window is about to be scored N times over
snapshot - the platform's progress record for the sweep. Non-null only on BacktestStage.EXECUTING events

public record SweepProgressEvent(BacktestStage stage, Double percent, Double coverageRatio, com.qtsurfer.api.client.model.SweepProgress snapshot) extends Record
Emitted at stage transitions and after each poll of a running sweep.

The snapshot is where the detail lives, and two of its fields are easy to add together by mistake:

  • SweepProgress.getAborted() counts individual runs that executed and aborted — a row-level count.
  • SweepProgress.getFailedShards() counts whole units of work (shards, or folds on a walk-forward sweep) that failed and will not be retried, having never reported anything.

They measure different things: a shard that dies before producing a single row leaves aborted at zero, which is exactly why the second count exists. Summing them double-counts nothing and describes nothing.

SweepProgress.getRetrying() is not a failure count either — those units failed on something transient and are queued to be attempted again, so a sweep with a non-zero value there is still expected to finish.

SweepProgress.getEtaSeconds() is omitted, never zero when it cannot be computed: a sweep with nothing finished has no observed rate to extrapolate from, and a zero would read as "about to finish". When present it runs conservative — it excludes queue wait entirely, and a sweep that spent part of its life being retried will have diluted the rate it is derived from.

  • Constructor Details

    • SweepProgressEvent

      public SweepProgressEvent(BacktestStage stage, Double percent)
      Convenience form for stage transitions and preparation progress; coverageRatio and snapshot default to null.
      Parameters:
      stage - current workflow stage
      percent - 0-100, or null
    • SweepProgressEvent

      public SweepProgressEvent(BacktestStage stage, Double percent, Double coverageRatio, com.qtsurfer.api.client.model.SweepProgress snapshot)
      Creates an instance of a SweepProgressEvent record class.
      Parameters:
      stage - the value for the stage record component
      percent - the value for the percent record component
      coverageRatio - the value for the coverageRatio record component
      snapshot - the value for the snapshot record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • stage

      public BacktestStage stage()
      Returns the value of the stage record component.
      Returns:
      the value of the stage record component
    • percent

      public Double percent()
      Returns the value of the percent record component.
      Returns:
      the value of the percent record component
    • coverageRatio

      public Double coverageRatio()
      Returns the value of the coverageRatio record component.
      Returns:
      the value of the coverageRatio record component
    • snapshot

      public com.qtsurfer.api.client.model.SweepProgress snapshot()
      Returns the value of the snapshot record component.
      Returns:
      the value of the snapshot record component