Class CSVLogger

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

public class CSVLogger extends SystemLogger
Class for recoding/printing results to a CSV file called `out.csv`.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    DISABLE_STRING = "no".
    static final String
    REGULAR_PRINT = "Regular".
    static final String
    TOTAL_PRINT = "Total".
  • Constructor Summary

    Constructors
    Constructor
    Description
    calls its super class SystemLogger.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Add the Metric type specific command line arguments.
    void
    Close the Logger.
    protected final String
     
    protected final boolean
     
    void
    open(ParsedOptions params, String storageName, Action action, io.time.Time time)
    Open the Logger.
    final void
    final public method to Open CSV.
    void
    Parse the Metric specific command line arguments.
    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[] percentileValues)
    Print the Periodic performance results.
    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[] percentileValues)
     
    final void
    writeToCSV(String header, String type, long connections, long maxConnections, 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[] percentileValues)
    final public method to write CSV.

    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 java.lang.Object

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

    Methods inherited from interface io.sbk.logger.Logger

    setExceptionHandler

    Methods inherited from interface io.perl.logger.PerformanceLogger

    getMaxLatency, getMinLatency, getPercentiles, getTimeUnit

    Methods inherited from interface io.sbk.logger.RWLogger

    recordLatency
  • Field Details

  • Constructor Details

    • CSVLogger

      public CSVLogger()
      calls its super class SystemLogger.
  • Method Details

    • isCsvEnable

      protected final boolean isCsvEnable()
    • getCsvFile

      protected final String getCsvFile()
    • 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
      Overrides:
      addArgs in class AbstractRWLogger
      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
      Overrides:
      parseArgs in class AbstractRWLogger
      Parameters:
      params - InputOptions object to be parsed for driver specific parameters/arguments.
      Throws:
      IllegalArgumentException - If an exception occurred.
    • openCSV

      public final void openCSV() throws IOException
      final public method to Open CSV.
      Throws:
      IOException - 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
      Overrides:
      open in class AbstractRWLogger
      Parameters:
      params - InputOptions object to be parsed for driver specific parameters/arguments.
      storageName - The Name of the storage.
      action - action to print
      time - time interface
      Throws:
      IOException - If an exception occurred.
    • writeToCSV

      public final void writeToCSV(String header, String type, long connections, long maxConnections, 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[] percentileValues)
      final public method to write CSV.
      Parameters:
      header - String
      type - String
      connections - long
      maxConnections - long
      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
      readRequestsMbPerSec - 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
      percentileValues - Array of percentile Values.
    • 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[] percentileValues)
      Description copied from interface: RWPrint
      Print the Periodic performance results.
      Specified by:
      print in interface RWPrint
      Overrides:
      print in class SystemLogger
      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
      percentileValues - Array of percentile Values.
    • 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[] percentileValues)
      Specified by:
      printTotal in interface RWLogger
      Overrides:
      printTotal in class SystemLogger
    • close

      public void close(ParsedOptions params) throws IOException
      Description copied from interface: Logger
      Close the Logger.
      Specified by:
      close in interface Logger
      Overrides:
      close in class AbstractRWLogger
      Parameters:
      params - InputOptions object to be parsed for driver specific parameters/arguments.
      Throws:
      IOException - If an exception occurred.