Class PrometheusLogger

java.lang.Object
io.perl.logger.impl.ResultsLogger
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:
GrpcLogger

public class PrometheusLogger extends CSVLogger
Class for Recoding/Printing benchmark results on micrometer Composite Meter Registry.
  • Constructor Details

    • PrometheusLogger

      public PrometheusLogger()
  • Method Details

    • getPrometheusRWMetricsServer

      public SbkPrometheusServer getPrometheusRWMetricsServer() throws IOException
      Throws:
      IOException
    • getMetricsConfigStream

      public InputStream getMetricsConfigStream()
    • getMetricsConfig

      protected final MetricsConfig getMetricsConfig()
    • 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 CSVLogger
      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 CSVLogger
      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 IllegalArgumentException, IOException
      Open the logger and, if metrics are enabled, start the Prometheus HTTP server.
      Specified by:
      open in interface Logger
      Overrides:
      open in class CSVLogger
      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.
      IllegalArgumentException
    • close

      public void close(ParsedOptions params) throws IllegalArgumentException, IOException
      Close the logger and stop the HTTP server if it was started.
      Specified by:
      close in interface Logger
      Overrides:
      close in class CSVLogger
      Parameters:
      params - ParsedOptions used during open; may carry shutdown options.
      Throws:
      IOException - If an exception occurred.
      IllegalArgumentException
    • 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 class: SystemLogger
      Print the periodic results to System.out at the end of each interval.
      Specified by:
      print in interface RWPrint
      Overrides:
      print in class CSVLogger
      Parameters:
      writers - number of active writers
      maxWriters - maximum writers seen
      readers - number of active readers
      maxReaders - maximum readers seen
      writeRequestBytes - write request bytes in this interval
      writeRequestMbPerSec - write request throughput in MB/sec
      writeRequestRecords - write request count
      writeRequestRecordsPerSec - write requests per second
      readRequestBytes - read request bytes in this interval
      readRequestMbPerSec - read request throughput in MB/sec
      readRequestRecords - 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 - reporting interval seconds
      bytes - total bytes processed in interval
      records - total records processed in interval
      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