Class LongStats

java.lang.Object
io.nosqlbench.virtdata.library.basics.shared.statistics.LongStats
All Implemented Interfaces:
DoubleUnaryOperator

public class LongStats extends Object implements DoubleUnaryOperator
Provide a moving aggregate (min,max,avg,sum,count) of long values presented. This allows for sanity checks on values during prototyping, primarily. Using it for other purposes in actual workloads is not generally desirable, as this does not produce purely functional (deterministic) values.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Given the specified statistic, provide an updated result for all the values presented to this function's input.
    LongStats(String spec, Object func, boolean truncate)
    Given the specified statistic, a function, and whether to allow truncating conversions, provide an updated result for all the values produced by the provided function when given the input.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    applyAsDouble(double operand)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.function.DoubleUnaryOperator

    andThen, compose
  • Constructor Details

    • LongStats

      public LongStats(String spec)
      Given the specified statistic, provide an updated result for all the values presented to this function's input.
      Parameters:
      spec - One of 'min', 'max', 'count', 'avg', or 'sum'
    • LongStats

      public LongStats(String spec, Object func, boolean truncate)
      Given the specified statistic, a function, and whether to allow truncating conversions, provide an updated result for all the values produced by the provided function when given the input.
      Parameters:
      spec - One of 'min', 'max', 'count', 'avg', or 'sum'
      func - Any function which can take a long or compatible input and produce a numeric value
      truncate - Whether or not to allow truncating conversions (long to int for example)
  • Method Details