Class DefaultLogger
- All Implemented Interfaces:
PerformanceLogger, Print, ReportLatency
- Direct Known Subclasses:
DefaultPrometheusLogger
This concrete logger is a thin convenience wrapper around
ResultsLogger that exposes two constructors: a fully-configurable
constructor and a no-argument convenience constructor that uses default
values from configuration. Use this logger when you want human-readable
results on the console or redirected to a file.
The individual-latency callback is a final no-op so the default reporting
path cannot add work to the single PerL performance-recorder thread. Custom
loggers that require individual latency values should extend
ResultsLogger or implement
PerformanceLogger directly.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor DefaultLogger takes no arguments but initialize all values with default values.DefaultLogger(String header, double[] percentiles, TimeUnit latencyTimeUnit, long minLatency, long maxLatency) Constructor DefaultLogger pass all values to its super class. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidrecordLatency(long startTime, int events, int bytes, long latency) Intentionally ignores the individual latency callback.final booleanIndicates whether this logger consumes every individual latency value.Methods inherited from class ResultsLogger
appendResultString, getMaxLatency, getMinLatency, getPercentileNames, getPercentiles, getPrefix, getTimeUnit, print, printTotal, setMaxLatency, setMinLatency, setPercentiles, setPrefix, setTimeUnitMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PerformanceLogger
getPrintingIntervalSeconds
-
Constructor Details
-
DefaultLogger
-
DefaultLogger
public DefaultLogger()Constructor DefaultLogger takes no arguments but initialize all values with default values.
-
-
Method Details
-
recordLatency
public final void recordLatency(long startTime, int events, int bytes, long latency) Intentionally ignores the individual latency callback.- Parameters:
startTime- event start timeevents- number of events represented by this measurementbytes- number of bytes represented by this measurementlatency- measured latency
-
recordsIndividualLatencies
public final boolean recordsIndividualLatencies()Description copied from interface:PerformanceLoggerIndicates whether this logger consumes every individual latency value.The default preserves compatibility for custom loggers. Loggers with a final no-op
PerformanceLogger.recordLatency(long, int, int, long)implementation should returnfalse, allowing PerL to omit the callback from its single-threaded measurement path.- Returns:
- true when PerL must invoke
recordLatencyfor every event
-