Class AbstractRWLogger

java.lang.Object
io.perl.logger.impl.ResultsLogger
io.sbk.logger.impl.AbstractRWLogger
All Implemented Interfaces:
io.perl.logger.PerformanceLogger, io.perl.logger.Print, io.perl.logger.ReportLatency, CountReaders, CountRW, CountWriters, Logger, ReadRequestsLogger, RWLogger, RWPrint, SetRW, WriteRequestsLogger
Direct Known Subclasses:
SystemLogger

public abstract class AbstractRWLogger extends io.perl.logger.impl.ResultsLogger implements RWLogger, SetRW
Base implementation of RWLogger providing shared read/write request accounting, periodic aggregation, and printing helpers. Subclasses implement concrete outputs (System out, CSV, Prometheus, gRPC) by overriding the print methods while reusing the counters, percentiles, and CLI configuration handling provided here.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Add the Metric type specific command line arguments.
    protected final void
    appendResultString(StringBuilder out, int writers, int maxWriters, int readers, int maxReaders, long writeRequestBytes, double writeRequestMbPerSec, long writeRequestRecords, double writeRequestRecordsPerSec, long readRequestBytes, double readRequestMBPerSec, long readRequestRecords, double readRequestRecordsPerSec, long writeResponsePendingRecords, long writeResponsePendingBytes, long readResponsePendingBytes, long readResponsePendingRecords, long writeReadRequestPendingRecords, long writeReadRequestPendingBytes, long writeTimeoutEvents, double writeTimeoutEventsPerSec, long readTimeoutEvents, double readTimeoutEventsPerSec, double seconds, long bytes, long records, double recsPerSec, double mbPerSec, double avgLatency, long minLatency, long maxLatency, long invalid, long lowerDiscard, long higherDiscard, long slc1, long slc2, long[] percentileLatencies, long[] percentileLatencyCounts)
     
    protected final void
    appendWriteAndReadRequests(@NotNull StringBuilder out, long writeRequestBytes, double writeRequestMbPerSec, long writesRequestRecords, double writeRequestRecordsPerSec, long readRequestBytes, double readRequestMbPerSec, long readRequestRecords, double readRequestRecordsPerSec)
     
    protected final void
    appendWriteAndReadRequestsPending(@NotNull StringBuilder out, long writeResponsePendingRecords, long writeResponsePendingBytes, long readResponsePendingBytes, long readResponsePendingRecords, long writeReadRequestPendingRecords, long writeReadRequestPendingBytes)
     
    protected final void
    appendWriteAndReadTimeoutEvents(@NotNull StringBuilder out, long writeTimeoutEvents, double writeTimeoutEventsPerSec, long readTimeoutEvents, double readeTimeoutEventsPerSec)
     
    protected final void
    appendWritesAndReaders(@NotNull StringBuilder out, int writers, int maxWriters, int readers, int maxReaders)
     
    void
    Close the Logger.
    void
    Decrements the count of active readers.
    void
    Decrements the count of active writers.
    protected final Action
     
     
    int
    Default method to indicate to record read requests or not.
    protected final int
     
    int
    Default method to indicate to record write requests or not.
    protected final int
     
    int
     
    protected final int
     
    protected final String
     
    protected final io.time.Time
     
    protected final int
     
    void
    Increments the count of active readers.
    void
    Increments the count of active writers.
    final boolean
     
    final boolean
     
    void
    open(ParsedOptions params, String storageName, Action action, io.time.Time time)
    Open the Logger.
    void
    Parse the Metric specific command line arguments.
    final void
    print(double seconds, long bytes, long records, double recsPerSec, double mbPerSec, double avgLatency, long minLatency, long maxLatency, long invalid, long lowerDiscard, long higherDiscard, long slc1, long slc2, long[] percentileLatencies, long[] percentileLatencyCounts)
     
    void
    print(int writers, int maxWriters, int readers, int maxReaders, long writeRequestBytes, double writeRequestMbPerSec, long writeRequestRecords, double writeRequestRecordsPerSec, long readRequestBytes, double readRequestMbPerSec, long readRequestRecords, double readRequestRecordsPerSec, long writeResponsePendingRecords, long writeResponsePendingBytes, long readResponsePendingRecords, long readResponsePendingBytes, long writeReadRequestPendingRecords, long writeReadRequestPendingBytes, long writeTimeoutEvents, double writeTimeoutEventsPerSec, long readTimeoutEvents, double readTimeoutEventsPerSec, double seconds, long bytes, long records, double recsPerSec, double mbPerSec, double avgLatency, long minLatency, long maxLatency, long invalid, long lowerDiscard, long higherDiscard, long slc1, long slc2, long[] percentileLatencies, long[] percentileLatencyCounts)
    Print the Periodic performance results.
    final void
    printTotal(double seconds, long bytes, long records, double recsPerSec, double mbPerSec, double avgLatency, long minLatency, long maxLatency, long invalid, long lowerDiscard, long higherDiscard, long slc1, long slc2, long[] percentileLatencies, long[] percentileLatencyCounts)
     
    void
    printTotal(int writers, int maxWriters, int readers, int maxReaders, long writeRequestBytes, double writeRequestMbPerSec, long writeRequestRecords, double writeRequestRecordsPerSec, long readRequestBytes, double readRequestsMbPerSec, long readRequestRecords, double readRequestRecordsPerSec, long writeResponsePendingRecords, long writeResponsePendingBytes, long readResponsePendingRecords, long readResponsePendingBytes, long writeReadRequestPendingRecords, long writeReadRequestPendingBytes, long writeTimeoutEvents, double writeTimeoutEventsPerSec, long readTimeoutEvents, double readTimeoutEventsPerSec, double seconds, long bytes, long records, double recsPerSec, double mbPerSec, double avgLatency, long minLatency, long maxLatency, long invalid, long lowerDiscard, long higherDiscard, long slc1, long slc2, long[] percentileLatencies, long[] percentileLatencyCounts)
    Print the "Total" roll-up, typically at the end of a benchmark run.
    void
    recordReadRequests(int readerId, long startTime, long bytes, long events)
    Default method to record every/multiple read event(s).
    void
    recordReadTimeoutEvents(int readerId, long startTime, long timeoutEvents)
    Record read timeout events for a reader.
    void
    recordWriteRequests(int writerId, long startTime, long bytes, long events)
    Default method to record every/multiple write event(s).
    void
    recordWriteTimeoutEvents(int writerId, long startTime, long timeoutEvents)
    Record write timeout events for a writer.
    final void
    setMaxReaders(int val)
    Update the max number of readers seen so far.
    protected final void
    setMaxReadersIds(int maxReaderRequestIds)
     
    final void
    setMaxWriters(int val)
    Update the max number of writers seen so far.
    protected final void
    setMaxWritersIds(int maxWriterRequestIds)
     
    final void
    setReaders(int val)
    Set current number of active readers.
    final void
    setWriters(int val)
    Set current number of active writers.

    Methods inherited from class io.perl.logger.impl.ResultsLogger

    appendResultString, getMaxLatency, getMinLatency, getPercentileNames, getPercentiles, getPrefix, getTimeUnit, setMaxLatency, setMinLatency, setPercentiles, setPrefix, setTimeUnit

    Methods inherited from class Object

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

    Methods inherited from interface Logger

    setExceptionHandler

    Methods inherited from interface io.perl.logger.PerformanceLogger

    getMaxLatency, getMinLatency, getPercentiles, getTimeUnit, recordLatency
  • Constructor Details

    • AbstractRWLogger

      public AbstractRWLogger()
  • Method Details

    • addArgs

      public void addArgs(InputOptions params) throws IllegalArgumentException
      Description copied from interface: Logger
      Add the Metric type specific command line arguments.
      Specified by:
      addArgs in interface Logger
      Parameters:
      params - InputOptions object to be extended.
      Throws:
      IllegalArgumentException - If an exception occurred.
    • parseArgs

      public void parseArgs(ParsedOptions params) throws IllegalArgumentException
      Description copied from interface: Logger
      Parse the Metric specific command line arguments.
      Specified by:
      parseArgs in interface Logger
      Parameters:
      params - ParsedOptions containing driver/logger specific parameters/arguments.
      Throws:
      IllegalArgumentException - If an exception occurred.
    • open

      public void open(ParsedOptions params, String storageName, Action action, io.time.Time time) throws IOException
      Description copied from interface: Logger
      Open the Logger.
      Specified by:
      open in interface Logger
      Parameters:
      params - ParsedOptions including logger-specific configuration.
      storageName - The Name of the storage.
      action - action to print
      time - time interface
      Throws:
      IOException - If an exception occurred.
    • close

      public void close(ParsedOptions params) throws IOException
      Description copied from interface: Logger
      Close the Logger.
      Specified by:
      close in interface Logger
      Parameters:
      params - ParsedOptions used during open; may carry shutdown options.
      Throws:
      IOException - If an exception occurred.
    • getMaxWriterIDs

      public int getMaxWriterIDs()
      Description copied from interface: RWLogger
      Default method to indicate to record write requests or not. Returning 0 disables per-writer request logging.
      Specified by:
      getMaxWriterIDs in interface RWLogger
      Specified by:
      getMaxWriterIDs in interface WriteRequestsLogger
      Returns:
      max writer IDs
    • getMaxReaderIDs

      public int getMaxReaderIDs()
      Description copied from interface: RWLogger
      Default method to indicate to record read requests or not. Returning 0 disables per-reader request logging.
      Specified by:
      getMaxReaderIDs in interface ReadRequestsLogger
      Specified by:
      getMaxReaderIDs in interface RWLogger
      Returns:
      max reader IDs
    • getPrintingIntervalSeconds

      public int getPrintingIntervalSeconds()
      Specified by:
      getPrintingIntervalSeconds in interface io.perl.logger.PerformanceLogger
    • incrementWriters

      public void incrementWriters()
      Description copied from interface: CountWriters
      Increments the count of active writers. This method should be called when a new writer becomes active.
      Specified by:
      incrementWriters in interface CountWriters
    • decrementWriters

      public void decrementWriters()
      Description copied from interface: CountWriters
      Decrements the count of active writers. This method should be called when a writer completes its operation or becomes inactive.
      Specified by:
      decrementWriters in interface CountWriters
    • incrementReaders

      public void incrementReaders()
      Description copied from interface: CountReaders
      Increments the count of active readers. This method should be called when a new reader becomes active.
      Specified by:
      incrementReaders in interface CountReaders
    • decrementReaders

      public void decrementReaders()
      Description copied from interface: CountReaders
      Decrements the count of active readers. This method should be called when a reader completes its operation or becomes inactive.
      Specified by:
      decrementReaders in interface CountReaders
    • recordWriteRequests

      public void recordWriteRequests(int writerId, long startTime, long bytes, long events)
      Description copied from interface: RWLogger
      Default method to record every/multiple write event(s). No-op by default.
      Specified by:
      recordWriteRequests in interface RWLogger
      Specified by:
      recordWriteRequests in interface WriteRequestsLogger
      Parameters:
      writerId - logical writer identifier (0..N-1)
      startTime - write start time in the active TimeUnit
      bytes - bytes written for these events
      events - number of write events
    • recordWriteTimeoutEvents

      public void recordWriteTimeoutEvents(int writerId, long startTime, long timeoutEvents)
      Description copied from interface: WriteRequestsLogger
      Record write timeout events for a writer.
      Specified by:
      recordWriteTimeoutEvents in interface WriteRequestsLogger
      Parameters:
      writerId - logical writer identifier (0..N-1)
      startTime - time when timeouts were observed
      timeoutEvents - number of timeout events
    • recordReadRequests

      public void recordReadRequests(int readerId, long startTime, long bytes, long events)
      Description copied from interface: RWLogger
      Default method to record every/multiple read event(s). No-op by default.
      Specified by:
      recordReadRequests in interface ReadRequestsLogger
      Specified by:
      recordReadRequests in interface RWLogger
      Parameters:
      readerId - logical reader identifier (0..N-1)
      startTime - read start time in the active TimeUnit
      bytes - bytes read for these events
      events - number of read events
    • recordReadTimeoutEvents

      public void recordReadTimeoutEvents(int readerId, long startTime, long timeoutEvents)
      Description copied from interface: ReadRequestsLogger
      Record read timeout events for a reader.
      Specified by:
      recordReadTimeoutEvents in interface ReadRequestsLogger
      Parameters:
      readerId - logical reader identifier (0..N-1)
      startTime - time when timeouts were observed
      timeoutEvents - number of timeout events
    • getLoggerConfigStream

      public InputStream getLoggerConfigStream()
    • getStorageName

      protected final String getStorageName()
    • getTime

      protected final io.time.Time getTime()
    • getAction

      protected final Action getAction()
    • setMaxWritersIds

      protected final void setMaxWritersIds(int maxWriterRequestIds)
    • setMaxReadersIds

      protected final void setMaxReadersIds(int maxReaderRequestIds)
    • getWritersCount

      protected final int getWritersCount()
    • getReadersCount

      protected final int getReadersCount()
    • getMaxWritersCount

      protected final int getMaxWritersCount()
    • getMaxReadersCount

      protected final int getMaxReadersCount()
    • setWriters

      public final void setWriters(int val)
      Description copied from interface: SetRW
      Set current number of active writers.
      Specified by:
      setWriters in interface SetRW
      Parameters:
      val - new value.
    • setMaxWriters

      public final void setMaxWriters(int val)
      Description copied from interface: SetRW
      Update the max number of writers seen so far.
      Specified by:
      setMaxWriters in interface SetRW
      Parameters:
      val - new value.
    • setReaders

      public final void setReaders(int val)
      Description copied from interface: SetRW
      Set current number of active readers.
      Specified by:
      setReaders in interface SetRW
      Parameters:
      val - new value.
    • setMaxReaders

      public final void setMaxReaders(int val)
      Description copied from interface: SetRW
      Update the max number of readers seen so far.
      Specified by:
      setMaxReaders in interface SetRW
      Parameters:
      val - new value.
    • isWriteRequestsEnabled

      public final boolean isWriteRequestsEnabled()
    • isReadRequestsEnabled

      public final boolean isReadRequestsEnabled()
    • appendWritesAndReaders

      protected final void appendWritesAndReaders(@NotNull @NotNull StringBuilder out, int writers, int maxWriters, int readers, int maxReaders)
    • appendWriteAndReadRequests

      protected final void appendWriteAndReadRequests(@NotNull @NotNull StringBuilder out, long writeRequestBytes, double writeRequestMbPerSec, long writesRequestRecords, double writeRequestRecordsPerSec, long readRequestBytes, double readRequestMbPerSec, long readRequestRecords, double readRequestRecordsPerSec)
    • appendWriteAndReadRequestsPending

      protected final void appendWriteAndReadRequestsPending(@NotNull @NotNull StringBuilder out, long writeResponsePendingRecords, long writeResponsePendingBytes, long readResponsePendingBytes, long readResponsePendingRecords, long writeReadRequestPendingRecords, long writeReadRequestPendingBytes)
    • appendWriteAndReadTimeoutEvents

      protected final void appendWriteAndReadTimeoutEvents(@NotNull @NotNull StringBuilder out, long writeTimeoutEvents, double writeTimeoutEventsPerSec, long readTimeoutEvents, double readeTimeoutEventsPerSec)
    • appendResultString

      protected final void appendResultString(StringBuilder out, int writers, int maxWriters, int readers, int maxReaders, long writeRequestBytes, double writeRequestMbPerSec, long writeRequestRecords, double writeRequestRecordsPerSec, long readRequestBytes, double readRequestMBPerSec, long readRequestRecords, double readRequestRecordsPerSec, long writeResponsePendingRecords, long writeResponsePendingBytes, long readResponsePendingBytes, long readResponsePendingRecords, long writeReadRequestPendingRecords, long writeReadRequestPendingBytes, long writeTimeoutEvents, double writeTimeoutEventsPerSec, long readTimeoutEvents, double readTimeoutEventsPerSec, double seconds, long bytes, long records, double recsPerSec, double mbPerSec, double avgLatency, long minLatency, long maxLatency, long invalid, long lowerDiscard, long higherDiscard, long slc1, long slc2, long[] percentileLatencies, long[] percentileLatencyCounts)
    • print

      public final void print(double seconds, long bytes, long records, double recsPerSec, double mbPerSec, double avgLatency, long minLatency, long maxLatency, long invalid, long lowerDiscard, long higherDiscard, long slc1, long slc2, long[] percentileLatencies, long[] percentileLatencyCounts)
      Specified by:
      print in interface io.perl.logger.Print
      Overrides:
      print in class io.perl.logger.impl.ResultsLogger
    • print

      public void print(int writers, int maxWriters, int readers, int maxReaders, long writeRequestBytes, double writeRequestMbPerSec, long writeRequestRecords, double writeRequestRecordsPerSec, long readRequestBytes, double readRequestMbPerSec, long readRequestRecords, double readRequestRecordsPerSec, long writeResponsePendingRecords, long writeResponsePendingBytes, long readResponsePendingRecords, long readResponsePendingBytes, long writeReadRequestPendingRecords, long writeReadRequestPendingBytes, long writeTimeoutEvents, double writeTimeoutEventsPerSec, long readTimeoutEvents, double readTimeoutEventsPerSec, double seconds, long bytes, long records, double recsPerSec, double mbPerSec, double avgLatency, long minLatency, long maxLatency, long invalid, long lowerDiscard, long higherDiscard, long slc1, long slc2, long[] percentileLatencies, long[] percentileLatencyCounts)
      Description copied from interface: RWPrint
      Print the Periodic performance results.
      Specified by:
      print in interface RWPrint
      Parameters:
      writers - number of active writers
      maxWriters - Max writers
      readers - number of active readers
      maxReaders - Max Readers
      writeRequestBytes - Write requests Bytes
      writeRequestMbPerSec - Write requests MB/sec
      writeRequestRecords - Write Requests
      writeRequestRecordsPerSec - Write Requests/sec
      readRequestBytes - Read requests Bytes
      readRequestMbPerSec - Read requests MB/sec
      readRequestRecords - Read requests
      readRequestRecordsPerSec - Read Requests/sec
      writeResponsePendingRecords - Write response pending records
      writeResponsePendingBytes - Write response pending bytes
      readResponsePendingRecords - Read response pending records
      readResponsePendingBytes - Read response pending bytes
      writeReadRequestPendingRecords - Write read pending records
      writeReadRequestPendingBytes - Write read pending bytes
      writeTimeoutEvents - Timeout Write Events
      writeTimeoutEventsPerSec - Timeout Write Events/sec
      readTimeoutEvents - Timeout Read Events
      readTimeoutEventsPerSec - Timeout Write Events/sec
      seconds - reporting duration in seconds
      bytes - number of bytes read/write
      records - data to write.
      recsPerSec - records per second.
      mbPerSec - Throughput value in terms of MB (Mega Bytes) per Second.
      avgLatency - Average Latency.
      minLatency - Minimum Latency.
      maxLatency - Maximum Latency.
      invalid - Number of invalid/negative latencies.
      lowerDiscard - number of discarded latencies which are less than minimum latency.
      higherDiscard - number of discarded latencies which are higher than maximum latency.
      slc1 - Sliding Latency Coverage factor
      slc2 - Sliding Latency Coverage factor
      percentileLatencies - Array of percentile latency Values.
      percentileLatencyCounts - Array of percentile latency Counts.
    • printTotal

      public final void printTotal(double seconds, long bytes, long records, double recsPerSec, double mbPerSec, double avgLatency, long minLatency, long maxLatency, long invalid, long lowerDiscard, long higherDiscard, long slc1, long slc2, long[] percentileLatencies, long[] percentileLatencyCounts)
      Specified by:
      printTotal in interface io.perl.logger.PerformanceLogger
      Overrides:
      printTotal in class io.perl.logger.impl.ResultsLogger
    • printTotal

      public void printTotal(int writers, int maxWriters, int readers, int maxReaders, long writeRequestBytes, double writeRequestMbPerSec, long writeRequestRecords, double writeRequestRecordsPerSec, long readRequestBytes, double readRequestsMbPerSec, long readRequestRecords, double readRequestRecordsPerSec, long writeResponsePendingRecords, long writeResponsePendingBytes, long readResponsePendingRecords, long readResponsePendingBytes, long writeReadRequestPendingRecords, long writeReadRequestPendingBytes, long writeTimeoutEvents, double writeTimeoutEventsPerSec, long readTimeoutEvents, double readTimeoutEventsPerSec, double seconds, long bytes, long records, double recsPerSec, double mbPerSec, double avgLatency, long minLatency, long maxLatency, long invalid, long lowerDiscard, long higherDiscard, long slc1, long slc2, long[] percentileLatencies, long[] percentileLatencyCounts)
      Description copied from interface: RWLogger
      Specified by:
      printTotal in interface RWLogger
      Parameters:
      writers - number of active writers
      maxWriters - maximum writers seen
      readers - number of active readers
      maxReaders - maximum readers seen
      writeRequestBytes - total write request bytes
      writeRequestMbPerSec - write request throughput in MB/sec
      writeRequestRecords - total write request count
      writeRequestRecordsPerSec - write requests per second
      readRequestBytes - total read request bytes
      readRequestsMbPerSec - read request throughput in MB/sec
      readRequestRecords - total read request count
      readRequestRecordsPerSec - read requests per second
      writeResponsePendingRecords - pending write response records
      writeResponsePendingBytes - pending write response bytes
      readResponsePendingRecords - pending read response records
      readResponsePendingBytes - pending read response bytes
      writeReadRequestPendingRecords - write-read pending records delta
      writeReadRequestPendingBytes - write-read pending bytes delta
      writeTimeoutEvents - write timeout events count
      writeTimeoutEventsPerSec - write timeout events per second
      readTimeoutEvents - read timeout events count
      readTimeoutEventsPerSec - read timeout events per second
      seconds - total time in seconds
      bytes - total bytes processed
      records - total records processed
      recsPerSec - records per second
      mbPerSec - MB per second
      avgLatency - average latency
      minLatency - minimum latency
      maxLatency - maximum latency
      invalid - invalid/negative latency count
      lowerDiscard - discarded below min latency
      higherDiscard - discarded above max latency
      slc1 - sliding latency coverage 1
      slc2 - sliding latency coverage 2
      percentileLatencies - percentile latency values
      percentileLatencyCounts - percentile latency counts