Class ElapsedFlux

All Implemented Interfaces:
Expression, HasImports

public class ElapsedFlux extends AbstractParametrizedFlux
Add an extra "elapsed" column to the result showing the time elapsed since the previous record in the series.

Example

    Flux flux = Flux.from("my-bucket")
        .range(Instant.now().minus(15, ChronoUnit.MINUTES), Instant.now())
        .filter(Restrictions.measurement().equal("wumpus"))
        .elapsed(new TimeInterval(100L, ChronoUnit.NANOS));
   
  • Constructor Details

    • ElapsedFlux

      public ElapsedFlux(@Nonnull Flux source)
  • Method Details

    • operatorName

      @Nonnull protected String operatorName()
      Specified by:
      operatorName in class AbstractParametrizedFlux
      Returns:
      name of function
    • withDuration

      public ElapsedFlux withDuration(TimeInterval duration)
      Parameters:
      duration - - TimeInterval to be used for units when reporting elapsed period.
      Returns:
      this
    • collectImports

      public void collectImports(@Nonnull Set<String> collectedImports)
      Description copied from class: Flux
      Collects all imports of the flux.
      Overrides:
      collectImports in class Flux
      Parameters:
      collectedImports - a set to be filled by the used imports