Class RecordMeter

java.lang.Object
com.northconcepts.datapipeline.meter.Meter
com.northconcepts.datapipeline.meter.RecordMeter

public class RecordMeter extends Meter
A Meter that counts records or their estimated size in bytes.
  • Constructor Details

    • RecordMeter

      public RecordMeter()
  • Method Details

    • getMeasure

      public RecordMeter.MeterUnit getMeasure()
      Returns whether each record adds its estimated size in bytes or one to the count (defaults to BYTES).
    • setMeasure

      public RecordMeter setMeasure(RecordMeter.MeterUnit measure)
      Sets whether each record adds its estimated size in bytes or one to the count (defaults to BYTES).
    • getUnitsPerSecondAsString

      public String getUnitsPerSecondAsString()
      Description copied from class: Meter
      Returns the rate as a human readable string scaled by powers of 1000, such as 12.5 kilo-units/s.
      Overrides:
      getUnitsPerSecondAsString in class Meter
    • add

      public Record add(Record record)
      Counts the record according to the measure (its estimated size in bytes or one) and returns it; null is ignored.
    • addExceptionProperties

      public DataException addExceptionProperties(DataException exception)
      Description copied from class: Meter
      Adds this meter's count and timer state to the given exception and returns it.
      Overrides:
      addExceptionProperties in class Meter