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
FieldsModifier and TypeFieldDescriptionprotected final StringMetric name prefix derived from the header (upper-cased and '_' separated).Fields inherited from class io.perl.logger.impl.PrintMetrics
registryFields 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
ConstructorsConstructorDescriptionSbkPrometheusServer(String header, String action, String className, double[] percentiles, io.time.Time time, MetricsConfig config) Construct the SBK Prometheus metrics server. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidprint(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, stopMethods inherited from class io.perl.logger.impl.PrintMetrics
close, print
-
Field Details
-
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 publishtime- time provider for latency measurementsconfig- 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:
printin interfaceRWPrint- Parameters:
writers- current writersmaxWriters- max writers observedreaders- current readersmaxReaders- max readers observedwriteRequestBytes- write request bytes in this intervalwriteRequestMbPerSec- write throughput MB/secwriteRequestRecords- write request countwriteRequestRecordsPerSec- write requests/secreadRequestBytes- read request bytes in this intervalreadRequestMbPerSec- read throughput MB/secreadRequestRecords- read request countreadRequestRecordsPerSec- read requests/secwriteResponsePendingRecords- pending write response recordswriteResponsePendingBytes- pending write response bytesreadResponsePendingRecords- pending read response recordsreadResponsePendingBytes- pending read response byteswriteReadRequestPendingRecords- write-read pending recordswriteReadRequestPendingBytes- write-read pending byteswriteTimeoutEvents- write timeout eventswriteTimeoutEventsPerSec- write timeout events/secreadTimeoutEvents- read timeout eventsreadTimeoutEventsPerSec- read timeout events/secseconds- reporting period secondsbytes- total bytes in periodrecords- total records in periodrecsPerSec- records/secmbPerSec- MB/secavgLatency- average latencyminLatency- minimum latencymaxLatency- maximum latencyinvalid- invalid/negative latency countlowerDiscard- discarded below min latencyhigherDiscard- discarded above max latencyslc1- sliding latency coverage 1slc2- sliding latency coverage 2percentileLatencies- percentile latency valuespercentileLatencyCounts- percentile latency counts
-