Class SbkPrometheusServer

java.lang.Object
io.perl.logger.impl.Metrics
io.perl.logger.impl.PrintMetrics
io.perl.logger.impl.PrometheusMetricsServer
io.sbk.logger.impl.SbkPrometheusServer
All Implemented Interfaces:
io.perl.logger.Print, RWPrint

public class SbkPrometheusServer extends io.perl.logger.impl.PrometheusMetricsServer implements RWPrint
Prometheus metrics server adapter for SBK read/write benchmarks.

This class bridges SBK's RWPrint reporting callbacks to Micrometer counters and gauges and exposes them via the embedded HTTP server implemented in PrometheusMetricsServer so that Prometheus can scrape them. It publishes per-interval throughput, request counts, pending records/bytes, timeout events, as well as statistical latency metrics (avg/min/max/discards and percentiles).

Metrics are tagged with the SBK storage class name (tag key: class) and the action (tag key: action). Metric names are prefixed using an upper-cased header (for example, SBK_READ) and follow a stable schema, such as <prefix>_Write_Request_Bytes, <prefix>_Read_Request_RecordsPerSec, etc.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final String
    Metric name prefix derived from the header (upper-cased and '_' separated).

    Fields inherited from class io.perl.logger.impl.PrintMetrics

    registry

    Fields inherited from class io.perl.logger.impl.Metrics

    avgLatencyName, bytesName, higherDiscardName, invalidLatencyRecordsName, lowerDiscardName, maxLatencyName, mbPsecName, metricPrefix, metricTimeUnit, minLatencyName, percentileFormat, percentileLatencyCountNames, percentileLatencyNames, recordsName, recsPsecName, slc1Name, slc2Name
  • Constructor Summary

    Constructors
    Constructor
    Description
    SbkPrometheusServer(String header, String action, String className, double[] percentiles, io.time.Time time, MetricsConfig config)
    Construct the SBK Prometheus metrics server.
  • Method Summary

    Modifier and Type
    Method
    Description
    final 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)
    Update Micrometer counters/gauges and delegate latency stats to the base server.

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

    start, stop

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

    close, print

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • rwMetricPrefix

      protected final String rwMetricPrefix
      Metric name prefix derived from the header (upper-cased and '_' separated).
  • Constructor Details

    • SbkPrometheusServer

      public SbkPrometheusServer(String header, String action, String className, double[] percentiles, io.time.Time time, MetricsConfig config) throws IOException
      Construct the SBK Prometheus metrics server.
      Parameters:
      header - SBK header (used to derive the metric name prefix)
      action - SBK action (READ/WRITE)
      className - storage implementation class name (exposed as a tag)
      percentiles - percentile configuration to publish
      time - time provider for latency measurements
      config - metrics endpoint configuration (port, context, latency time unit)
      Throws:
      IOException - if the underlying server cannot be initialized
  • Method Details

    • print

      public final 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)
      Update Micrometer counters/gauges and delegate latency stats to the base server.
      Specified by:
      print in interface RWPrint
      Parameters:
      writers - current writers
      maxWriters - max writers observed
      readers - current readers
      maxReaders - max readers observed
      writeRequestBytes - write request bytes in this interval
      writeRequestMbPerSec - write throughput MB/sec
      writeRequestRecords - write request count
      writeRequestRecordsPerSec - write requests/sec
      readRequestBytes - read request bytes in this interval
      readRequestMbPerSec - read throughput MB/sec
      readRequestRecords - read request count
      readRequestRecordsPerSec - read requests/sec
      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
      writeReadRequestPendingBytes - write-read pending bytes
      writeTimeoutEvents - write timeout events
      writeTimeoutEventsPerSec - write timeout events/sec
      readTimeoutEvents - read timeout events
      readTimeoutEventsPerSec - read timeout events/sec
      seconds - reporting period seconds
      bytes - total bytes in period
      records - total records in period
      recsPerSec - records/sec
      mbPerSec - MB/sec
      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