Class AbstractRWLogger
java.lang.Object
io.perl.logger.impl.ResultsLogger
io.sbk.logger.impl.AbstractRWLogger
- 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:
SystemLogger
public abstract class AbstractRWLogger
extends io.perl.logger.impl.ResultsLogger
implements RWLogger, SetRW
Base implementation of
RWLogger providing shared read/write request accounting,
periodic aggregation, and printing helpers. Subclasses implement concrete outputs
(System out, CSV, Prometheus, gRPC) by overriding the print methods while reusing the
counters, percentiles, and CLI configuration handling provided here.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddArgs(InputOptions params) Add the Metric type specific command line arguments.protected final voidappendResultString(StringBuilder out, 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 readResponsePendingBytes, long readResponsePendingRecords, 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) protected final voidappendWriteAndReadRequests(@NotNull StringBuilder out, long writeRequestBytes, double writeRequestMbPerSec, long writesRequestRecords, double writeRequestRecordsPerSec, long readRequestBytes, double readRequestMbPerSec, long readRequestRecords, double readRequestRecordsPerSec) protected final voidappendWriteAndReadRequestsPending(@NotNull StringBuilder out, long writeResponsePendingRecords, long writeResponsePendingBytes, long readResponsePendingBytes, long readResponsePendingRecords, long writeReadRequestPendingRecords, long writeReadRequestPendingBytes) protected final voidappendWriteAndReadTimeoutEvents(@NotNull StringBuilder out, long writeTimeoutEvents, double writeTimeoutEventsPerSec, long readTimeoutEvents, double readeTimeoutEventsPerSec) protected final voidappendWritesAndReaders(@NotNull StringBuilder out, int writers, int maxWriters, int readers, int maxReaders) voidclose(ParsedOptions params) Close the Logger.voidDecrements the count of active readers.voidDecrements the count of active writers.protected final ActionintDefault method to indicate to record read requests or not.protected final intintDefault method to indicate to record write requests or not.protected final intintprotected final intprotected final Stringprotected final io.time.TimegetTime()protected final intvoidIncrements the count of active readers.voidIncrements the count of active writers.final booleanfinal booleanvoidopen(ParsedOptions params, String storageName, Action action, io.time.Time time) Open the Logger.voidparseArgs(ParsedOptions params) Parse the Metric specific command line arguments.final voidprint(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) 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 performance results.final voidprintTotal(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) 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 "Total" roll-up, typically at the end of a benchmark run.voidrecordReadRequests(int readerId, long startTime, long bytes, long events) Default method to record every/multiple read event(s).voidrecordReadTimeoutEvents(int readerId, long startTime, long timeoutEvents) Record read timeout events for a reader.voidrecordWriteRequests(int writerId, long startTime, long bytes, long events) Default method to record every/multiple write event(s).voidrecordWriteTimeoutEvents(int writerId, long startTime, long timeoutEvents) Record write timeout events for a writer.final voidsetMaxReaders(int val) Update the max number of readers seen so far.protected final voidsetMaxReadersIds(int maxReaderRequestIds) final voidsetMaxWriters(int val) Update the max number of writers seen so far.protected final voidsetMaxWritersIds(int maxWriterRequestIds) final voidsetReaders(int val) Set current number of active readers.final voidsetWriters(int val) Set current number of active writers.Methods 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 Logger
setExceptionHandlerMethods inherited from interface io.perl.logger.PerformanceLogger
getMaxLatency, getMinLatency, getPercentiles, getTimeUnit, recordLatency
-
Constructor Details
-
AbstractRWLogger
public AbstractRWLogger()
-
-
Method Details
-
addArgs
Description copied from interface:LoggerAdd the Metric type specific command line arguments.- Specified by:
addArgsin interfaceLogger- Parameters:
params- InputOptions object to be extended.- Throws:
IllegalArgumentException- If an exception occurred.
-
parseArgs
Description copied from interface:LoggerParse the Metric specific command line arguments.- Specified by:
parseArgsin interfaceLogger- 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 IOException Description copied from interface:LoggerOpen the Logger.- Specified by:
openin interfaceLogger- Parameters:
params- ParsedOptions including logger-specific configuration.storageName- The Name of the storage.action- action to printtime- time interface- Throws:
IOException- If an exception occurred.
-
close
Description copied from interface:LoggerClose the Logger.- Specified by:
closein interfaceLogger- Parameters:
params- ParsedOptions used during open; may carry shutdown options.- Throws:
IOException- If an exception occurred.
-
getMaxWriterIDs
public int getMaxWriterIDs()Description copied from interface:RWLoggerDefault method to indicate to record write requests or not. Returning 0 disables per-writer request logging.- Specified by:
getMaxWriterIDsin interfaceRWLogger- Specified by:
getMaxWriterIDsin interfaceWriteRequestsLogger- Returns:
- max writer IDs
-
getMaxReaderIDs
public int getMaxReaderIDs()Description copied from interface:RWLoggerDefault method to indicate to record read requests or not. Returning 0 disables per-reader request logging.- Specified by:
getMaxReaderIDsin interfaceReadRequestsLogger- Specified by:
getMaxReaderIDsin interfaceRWLogger- Returns:
- max reader IDs
-
getPrintingIntervalSeconds
public int getPrintingIntervalSeconds()- Specified by:
getPrintingIntervalSecondsin interfaceio.perl.logger.PerformanceLogger
-
incrementWriters
public void incrementWriters()Description copied from interface:CountWritersIncrements the count of active writers. This method should be called when a new writer becomes active.- Specified by:
incrementWritersin interfaceCountWriters
-
decrementWriters
public void decrementWriters()Description copied from interface:CountWritersDecrements the count of active writers. This method should be called when a writer completes its operation or becomes inactive.- Specified by:
decrementWritersin interfaceCountWriters
-
incrementReaders
public void incrementReaders()Description copied from interface:CountReadersIncrements the count of active readers. This method should be called when a new reader becomes active.- Specified by:
incrementReadersin interfaceCountReaders
-
decrementReaders
public void decrementReaders()Description copied from interface:CountReadersDecrements the count of active readers. This method should be called when a reader completes its operation or becomes inactive.- Specified by:
decrementReadersin interfaceCountReaders
-
recordWriteRequests
public void recordWriteRequests(int writerId, long startTime, long bytes, long events) Description copied from interface:RWLoggerDefault method to record every/multiple write event(s). No-op by default.- Specified by:
recordWriteRequestsin interfaceRWLogger- Specified by:
recordWriteRequestsin interfaceWriteRequestsLogger- Parameters:
writerId- logical writer identifier (0..N-1)startTime- write start time in the activeTimeUnitbytes- bytes written for these eventsevents- number of write events
-
recordWriteTimeoutEvents
public void recordWriteTimeoutEvents(int writerId, long startTime, long timeoutEvents) Description copied from interface:WriteRequestsLoggerRecord write timeout events for a writer.- Specified by:
recordWriteTimeoutEventsin interfaceWriteRequestsLogger- Parameters:
writerId- logical writer identifier (0..N-1)startTime- time when timeouts were observedtimeoutEvents- number of timeout events
-
recordReadRequests
public void recordReadRequests(int readerId, long startTime, long bytes, long events) Description copied from interface:RWLoggerDefault method to record every/multiple read event(s). No-op by default.- Specified by:
recordReadRequestsin interfaceReadRequestsLogger- Specified by:
recordReadRequestsin interfaceRWLogger- Parameters:
readerId- logical reader identifier (0..N-1)startTime- read start time in the activeTimeUnitbytes- bytes read for these eventsevents- number of read events
-
recordReadTimeoutEvents
public void recordReadTimeoutEvents(int readerId, long startTime, long timeoutEvents) Description copied from interface:ReadRequestsLoggerRecord read timeout events for a reader.- Specified by:
recordReadTimeoutEventsin interfaceReadRequestsLogger- Parameters:
readerId- logical reader identifier (0..N-1)startTime- time when timeouts were observedtimeoutEvents- number of timeout events
-
getLoggerConfigStream
-
getStorageName
-
getTime
protected final io.time.Time getTime() -
getAction
-
setMaxWritersIds
protected final void setMaxWritersIds(int maxWriterRequestIds) -
setMaxReadersIds
protected final void setMaxReadersIds(int maxReaderRequestIds) -
getWritersCount
protected final int getWritersCount() -
getReadersCount
protected final int getReadersCount() -
getMaxWritersCount
protected final int getMaxWritersCount() -
getMaxReadersCount
protected final int getMaxReadersCount() -
setWriters
public final void setWriters(int val) Description copied from interface:SetRWSet current number of active writers.- Specified by:
setWritersin interfaceSetRW- Parameters:
val- new value.
-
setMaxWriters
public final void setMaxWriters(int val) Description copied from interface:SetRWUpdate the max number of writers seen so far.- Specified by:
setMaxWritersin interfaceSetRW- Parameters:
val- new value.
-
setReaders
public final void setReaders(int val) Description copied from interface:SetRWSet current number of active readers.- Specified by:
setReadersin interfaceSetRW- Parameters:
val- new value.
-
setMaxReaders
public final void setMaxReaders(int val) Description copied from interface:SetRWUpdate the max number of readers seen so far.- Specified by:
setMaxReadersin interfaceSetRW- Parameters:
val- new value.
-
isWriteRequestsEnabled
public final boolean isWriteRequestsEnabled() -
isReadRequestsEnabled
public final boolean isReadRequestsEnabled() -
appendWritesAndReaders
protected final void appendWritesAndReaders(@NotNull @NotNull StringBuilder out, int writers, int maxWriters, int readers, int maxReaders) -
appendWriteAndReadRequests
protected final void appendWriteAndReadRequests(@NotNull @NotNull StringBuilder out, long writeRequestBytes, double writeRequestMbPerSec, long writesRequestRecords, double writeRequestRecordsPerSec, long readRequestBytes, double readRequestMbPerSec, long readRequestRecords, double readRequestRecordsPerSec) -
appendWriteAndReadRequestsPending
protected final void appendWriteAndReadRequestsPending(@NotNull @NotNull StringBuilder out, long writeResponsePendingRecords, long writeResponsePendingBytes, long readResponsePendingBytes, long readResponsePendingRecords, long writeReadRequestPendingRecords, long writeReadRequestPendingBytes) -
appendWriteAndReadTimeoutEvents
protected final void appendWriteAndReadTimeoutEvents(@NotNull @NotNull StringBuilder out, long writeTimeoutEvents, double writeTimeoutEventsPerSec, long readTimeoutEvents, double readeTimeoutEventsPerSec) -
appendResultString
protected final void appendResultString(StringBuilder out, 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 readResponsePendingBytes, long readResponsePendingRecords, 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
public final void print(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) - Specified by:
printin interfaceio.perl.logger.Print- Overrides:
printin classio.perl.logger.impl.ResultsLogger
-
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 interface:RWPrintPrint the Periodic performance results.- Specified by:
printin interfaceRWPrint- Parameters:
writers- number of active writersmaxWriters- Max writersreaders- number of active readersmaxReaders- Max ReaderswriteRequestBytes- Write requests ByteswriteRequestMbPerSec- Write requests MB/secwriteRequestRecords- Write RequestswriteRequestRecordsPerSec- Write Requests/secreadRequestBytes- Read requests BytesreadRequestMbPerSec- Read requests MB/secreadRequestRecords- Read requestsreadRequestRecordsPerSec- Read Requests/secwriteResponsePendingRecords- Write response pending recordswriteResponsePendingBytes- Write response pending bytesreadResponsePendingRecords- Read response pending recordsreadResponsePendingBytes- Read response pending byteswriteReadRequestPendingRecords- Write read pending recordswriteReadRequestPendingBytes- Write read pending byteswriteTimeoutEvents- Timeout Write EventswriteTimeoutEventsPerSec- Timeout Write Events/secreadTimeoutEvents- Timeout Read EventsreadTimeoutEventsPerSec- Timeout Write Events/secseconds- reporting duration in secondsbytes- number of bytes read/writerecords- 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 factorslc2- Sliding Latency Coverage factorpercentileLatencies- Array of percentile latency Values.percentileLatencyCounts- Array of percentile latency Counts.
-
printTotal
public final void printTotal(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) - Specified by:
printTotalin interfaceio.perl.logger.PerformanceLogger- Overrides:
printTotalin classio.perl.logger.impl.ResultsLogger
-
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[] percentileLatencies, long[] percentileLatencyCounts) Description copied from interface:RWLoggerPrint the "Total" roll-up, typically at the end of a benchmark run. Parameters mirrorRWPrint.print(int, int, int, int, long, double, long, double, long, double, long, double, long, long, long, long, long, long, long, double, long, double, double, long, long, double, double, double, long, long, long, long, long, long, long, long[], long[])- Specified by:
printTotalin interfaceRWLogger- Parameters:
writers- number of active writersmaxWriters- maximum writers seenreaders- number of active readersmaxReaders- maximum readers seenwriteRequestBytes- total write request byteswriteRequestMbPerSec- write request throughput in MB/secwriteRequestRecords- total write request countwriteRequestRecordsPerSec- write requests per secondreadRequestBytes- total read request bytesreadRequestsMbPerSec- read request throughput in MB/secreadRequestRecords- total 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- total time in 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
-