Class GrpcLogger
java.lang.Object
io.perl.logger.impl.ResultsLogger
io.sbk.logger.impl.AbstractRWLogger
io.sbk.logger.impl.GrpcLogger
- All Implemented Interfaces:
io.perl.logger.PerformanceLogger, io.perl.logger.Print, io.perl.logger.ReportLatency, CountReaders, CountRW, CountWriters, Logger, ReadRequestsLogger, RWLogger, RWPrint, SetRW, WriteRequestsLogger
Streams exact SBK latency frequencies and request counters to an SBM aggregator.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddArgs(InputOptions params) Add SBM host/port options and load defaults fromsbmhost.properties.voidclose(ParsedOptions params) Close the logger, unregister the client, and shutdown the gRPC channel.protected StringgetTimeStamp(long reportTime) Formats a report timestamp in the local time zone.voidopen(ParsedOptions params, String storageName, Action action, io.time.Time time) Open the logger, establish a gRPC channel, validate configuration with SBM, and prepare buffers.voidparseArgs(ParsedOptions params) Parse and validate the required SBM endpoint options.final 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) Print the periodic results toSystem.outat the end of each interval.voidprint(long reportTime, 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 periodic results locally and enqueue the corresponding exact latency batch for SBM.final voidprintTotal(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 final accumulated totals toSystem.outat the end of the run.voidprintTotal(long reportTime, 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 final accumulated totals toSystem.outat the end of the run.voidrecordLatency(long startTime, int events, int bytes, long latency) Record individual latency values into the localLatencyRecorderand stage them for gRPC export.voidreportFailure(Throwable failure) Sends a terminal SBK failure to SBM before closing the client channel.voidsetExceptionHandler(io.perl.exception.ExceptionHandler handler) Sets the benchmark exception handler notified when the gRPC transport fails.Methods inherited from class AbstractRWLogger
appendResultString, appendWriteAndReadRequests, appendWriteAndReadRequestsPending, appendWriteAndReadTimeoutEvents, appendWritesAndReaders, decrementReaders, decrementWriters, getAction, getConfiguredMaxRequestIds, getLoggerConfigStream, getMaxReaderIDs, getMaxReadersCount, getMaxWriterIDs, getMaxWritersCount, getPrintingIntervalSeconds, getReadersCount, getStorageName, getTime, getWritersCount, incrementReaders, incrementWriters, isReadRequestsEnabled, isWriteRequestsEnabled, print, printTotal, recordReadRequests, recordReadTimeoutEvents, recordWriteRequests, recordWriteTimeoutEvents, setMaxReaders, setMaxReadersIds, setMaxWriters, setMaxWritersIds, setReaders, setWritersMethods inherited from class io.perl.logger.impl.ResultsLogger
appendResultString, getMaxLatency, getMinLatency, getPercentileNames, getPercentiles, getPrefix, getTimeUnit, setMaxLatency, setMinLatency, setPercentiles, setPrefix, setTimeUnitMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.perl.logger.PerformanceLogger
getMaxLatency, getMinLatency, getPercentiles, getTimeUnit
-
Constructor Details
-
GrpcLogger
public GrpcLogger()Construct a gRPC logger. Calls super to initialize base logging and metrics behavior.
-
-
Method Details
-
setExceptionHandler
public void setExceptionHandler(io.perl.exception.ExceptionHandler handler) Sets the benchmark exception handler notified when the gRPC transport fails.- Parameters:
handler- exception handler invoked on transport failure
-
reportFailure
Sends a terminal SBK failure to SBM before closing the client channel.The RPC is deliberately outside the latency stream. Failure reporting is best effort so an older SBM that does not implement this RPC cannot mask the original storage or worker exception.
- Parameters:
failure- terminal benchmark failure
-
addArgs
Add SBM host/port options and load defaults fromsbmhost.properties.- Specified by:
addArgsin interfaceLogger- Overrides:
addArgsin classAbstractRWLogger- Parameters:
params- command-line option registry- Throws:
IllegalArgumentException- if the bundled SBM configuration cannot be loaded
-
parseArgs
Parse and validate the required SBM endpoint options.- Specified by:
parseArgsin interfaceLogger- Overrides:
parseArgsin classAbstractRWLogger- Parameters:
params- parsed command-line options- Throws:
IllegalArgumentException- if the SBM host is absent or the port is invalid
-
open
public void open(ParsedOptions params, String storageName, Action action, io.time.Time time) throws IllegalArgumentException, IOException Open the logger, establish a gRPC channel, validate configuration with SBM, and prepare buffers.- Specified by:
openin interfaceLogger- Overrides:
openin classAbstractRWLogger- Parameters:
params- parsed command-line optionsstorageName- storage driver name expected by SBMaction- benchmark action expected by SBMtime- benchmark time implementation- Throws:
IllegalArgumentException- if SBK and SBM configurations are incompatibleIOException- if the gRPC channel, registration, or stream cannot be initialized
-
close
Close the logger, unregister the client, and shutdown the gRPC channel.- Specified by:
closein interfaceLogger- Overrides:
closein classAbstractRWLogger- Parameters:
params- parsed command-line options- Throws:
IllegalArgumentException- if inherited logger shutdown validation failsIOException- if the stream cannot drain or the channel cannot close cleanly
-
recordLatency
public void recordLatency(long startTime, int events, int bytes, long latency) Record individual latency values into the localLatencyRecorderand stage them for gRPC export.- Parameters:
startTime- operation start timeevents- number of operations represented by this measurementbytes- number of bytes represented by this measurementlatency- measured operation latency
-
print
public void print(long reportTime, 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 periodic results locally and enqueue the corresponding exact latency batch for SBM.- Parameters:
reportTime- report time in millisecondswriters- active writersmaxWriters- maximum writersreaders- active readersmaxReaders- maximum readerswriteRequestBytes- write request byteswriteRequestMbPerSec- write request throughput in MB/secwriteRequestRecords- write request recordswriteRequestRecordsPerSec- write requests per secondreadRequestBytes- read request bytesreadRequestMbPerSec- read request throughput in MB/secreadRequestRecords- read request recordsreadRequestRecordsPerSec- read requests per secondwriteResponsePendingRecords- 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 per secondreadTimeoutEvents- read timeout eventsreadTimeoutEventsPerSec- read timeout events per secondseconds- reporting interval secondsbytes- bytes processedrecords- records processedrecsPerSec- records per secondmbPerSec- throughput in MB/secavgLatency- average latencyminLatency- minimum latencymaxLatency- maximum latencyinvalid- invalid latency countlowerDiscard- latencies discarded below the configured minimumhigherDiscard- latencies discarded above the configured maximumslc1- sliding latency coverage count 1slc2- sliding latency coverage count 2percentileLatencies- percentile latency valuespercentileLatencyCounts- percentile latency bucket counts
-
getTimeStamp
Formats a report timestamp in the local time zone.- Parameters:
reportTime- epoch-millisecond report time- Returns:
- formatted timestamp
-
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) Print the periodic results toSystem.outat the end of each interval.- Specified by:
printin interfaceRWPrint- Overrides:
printin classAbstractRWLogger- Parameters:
writers- number of active writersmaxWriters- maximum writers seenreaders- number of active readersmaxReaders- maximum readers seenwriteRequestBytes- write request bytes in this intervalwriteRequestMbPerSec- write request throughput in MB/secwriteRequestRecords- write request countwriteRequestRecordsPerSec- write requests per secondreadRequestBytes- read request bytes in this intervalreadRequestMbPerSec- read request throughput in MB/secreadRequestRecords- read request countreadRequestRecordsPerSec- read requests per secondwriteResponsePendingRecords- pending write response recordswriteResponsePendingBytes- pending write response bytesreadResponsePendingRecords- pending read response recordsreadResponsePendingBytes- pending read response byteswriteReadRequestPendingRecords- write-read pending records deltawriteReadRequestPendingBytes- write-read pending bytes deltawriteTimeoutEvents- write timeout events countwriteTimeoutEventsPerSec- write timeout events per secondreadTimeoutEvents- read timeout events countreadTimeoutEventsPerSec- read timeout events per secondseconds- reporting interval secondsbytes- total bytes processed in intervalrecords- total records processed in intervalrecsPerSec- records per secondmbPerSec- MB per secondavgLatency- 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
-
printTotal
public final 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 final accumulated totals toSystem.outat the end of the run.- Specified by:
printTotalin interfaceRWLogger- Overrides:
printTotalin classAbstractRWLogger- Parameters:
writers- number of active writersmaxWriters- maximum writers seenreaders- number of active readersmaxReaders- maximum readers seenwriteRequestBytes- write request bytes totalwriteRequestMbPerSec- write request throughput in MB/secwriteRequestRecords- write request count totalwriteRequestRecordsPerSec- write requests per secondreadRequestBytes- read request bytes totalreadRequestsMbPerSec- read request throughput in MB/secreadRequestRecords- read request count totalreadRequestRecordsPerSec- read requests per secondwriteResponsePendingRecords- pending write response recordswriteResponsePendingBytes- pending write response bytesreadResponsePendingRecords- pending read response recordsreadResponsePendingBytes- pending read response byteswriteReadRequestPendingRecords- write-read pending records deltawriteReadRequestPendingBytes- write-read pending bytes deltawriteTimeoutEvents- write timeout events countwriteTimeoutEventsPerSec- write timeout events per secondreadTimeoutEvents- read timeout events countreadTimeoutEventsPerSec- read timeout events per secondseconds- reporting secondsbytes- total bytes processedrecords- total records processedrecsPerSec- records per secondmbPerSec- MB per secondavgLatency- 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
-
printTotal
public void printTotal(long reportTime, 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 final accumulated totals toSystem.outat the end of the run.- Parameters:
reportTime- report time in millisecondswriters- number of active writersmaxWriters- maximum writers seenreaders- number of active readersmaxReaders- maximum readers seenwriteRequestBytes- write request bytes totalwriteRequestMbPerSec- write request throughput in MB/secwriteRequestRecords- write request count totalwriteRequestRecordsPerSec- write requests per secondreadRequestBytes- read request bytes totalreadRequestsMbPerSec- read request throughput in MB/secreadRequestRecords- read request count totalreadRequestRecordsPerSec- read requests per secondwriteResponsePendingRecords- pending write response recordswriteResponsePendingBytes- pending write response bytesreadResponsePendingRecords- pending read response recordsreadResponsePendingBytes- pending read response byteswriteReadRequestPendingRecords- write-read pending records deltawriteReadRequestPendingBytes- write-read pending bytes deltawriteTimeoutEvents- write timeout events countwriteTimeoutEventsPerSec- write timeout events per secondreadTimeoutEvents- read timeout events countreadTimeoutEventsPerSec- read timeout events per secondseconds- reporting secondsbytes- total bytes processedrecords- total records processedrecsPerSec- records per secondmbPerSec- MB per secondavgLatency- 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
-