Class CSVLogger
java.lang.Object
io.perl.logger.impl.ResultsLogger
io.sbk.logger.impl.AbstractRWLogger
io.sbk.logger.impl.SystemLogger
io.sbk.logger.impl.CSVLogger
- 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:
PrometheusLogger
Class for recoding/printing results to a CSV file called `out.csv`.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddArgs(InputOptions params) Add the Metric type specific command line arguments.voidclose(ParsedOptions params) Close the Logger.protected final Stringprotected final booleanvoidopen(ParsedOptions params, String storageName, Action action, io.time.Time time) Open the Logger.final voidopenCSV()Open the CSV and write the header line.voidparseArgs(ParsedOptions params) Parse the Metric specific command line arguments.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.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.final voidwriteToCSV(String header, String type, long connections, long maxConnections, 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) Write a single record (row) to the CSV file.Methods inherited from class AbstractRWLogger
appendResultString, appendWriteAndReadRequests, appendWriteAndReadRequestsPending, appendWriteAndReadTimeoutEvents, appendWritesAndReaders, decrementReaders, decrementWriters, getAction, 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 Logger
setExceptionHandlerMethods inherited from interface io.perl.logger.PerformanceLogger
getMaxLatency, getMinLatency, getPercentiles, getTimeUnit, recordLatency
-
Field Details
-
DISABLE_STRING
-
REGULAR_PRINT
-
TOTAL_PRINT
-
-
Constructor Details
-
CSVLogger
public CSVLogger()calls its super class SystemLogger.
-
-
Method Details
-
isCsvEnable
protected final boolean isCsvEnable() -
getCsvFile
-
addArgs
Description copied from interface:LoggerAdd the Metric type specific command line arguments.- Specified by:
addArgsin interfaceLogger- Overrides:
addArgsin classAbstractRWLogger- 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- Overrides:
parseArgsin classAbstractRWLogger- Parameters:
params- ParsedOptions containing driver/logger specific parameters/arguments.- Throws:
IllegalArgumentException- If an exception occurred.
-
openCSV
Open the CSV and write the header line.- Throws:
IOException- 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- Overrides:
openin classAbstractRWLogger- 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.
-
writeToCSV
public final void writeToCSV(String header, String type, long connections, long maxConnections, 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) Write a single record (row) to the CSV file.- Parameters:
header- Stringtype- Stringconnections- longmaxConnections- longwriters- 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 BytesreadRequestsMbPerSec- 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
-
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:SystemLoggerPrint the periodic results toSystem.outat the end of each interval.- Specified by:
printin interfaceRWPrint- Overrides:
printin classSystemLogger- 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 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 class:SystemLoggerPrint the final accumulated totals toSystem.outat the end of the run.- Specified by:
printTotalin interfaceRWLogger- Overrides:
printTotalin classSystemLogger- 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
-
close
Description copied from interface:LoggerClose the Logger.- Specified by:
closein interfaceLogger- Overrides:
closein classAbstractRWLogger- Parameters:
params- ParsedOptions used during open; may carry shutdown options.- Throws:
IOException- If an exception occurred.
-