Interface Logger
- All Superinterfaces:
io.perl.logger.PerformanceLogger, io.perl.logger.Print, io.perl.logger.ReportLatency
- All Known Subinterfaces:
RWLogger
- All Known Implementing Classes:
AbstractRWLogger, CSVLogger, GrpcLogger, PrometheusLogger, Sl4jLogger, SystemLogger, WebLogger
public interface Logger
extends io.perl.logger.PerformanceLogger
Primary logging interface for SBK benchmarks to configure, open, and close metrics reporting.
Implementations are responsible for:
- Adding and parsing metric-specific CLI arguments via
addArgs(InputOptions) and
parseArgs(ParsedOptions).
- Initializing resources on open(ParsedOptions, String, Action, Time) and releasing them
on close(ParsedOptions).
- Optionally integrating with SBK's ExceptionHandler using setExceptionHandler(ExceptionHandler).-
Method Summary
Modifier and TypeMethodDescriptionvoidaddArgs(InputOptions params) Add the Metric type specific command line arguments.voidclose(ParsedOptions params) Close the Logger.voidopen(ParsedOptions params, String storageName, Action action, io.time.Time time) Open the Logger.voidparseArgs(ParsedOptions params) Parse the Metric specific command line arguments.default voidreportFailure(Throwable failure) Reports a terminal benchmark failure before the logger transport is closed.default voidsetExceptionHandler(io.perl.exception.ExceptionHandler handler) Default implementation for setting exception handler.Methods inherited from interface io.perl.logger.PerformanceLogger
getMaxLatency, getMinLatency, getPercentiles, getPrintingIntervalSeconds, getTimeUnit, printTotal, recordLatencyMethods inherited from interface io.perl.logger.Print
print
-
Method Details
-
addArgs
Add the Metric type specific command line arguments.- Parameters:
params- InputOptions object to be extended.- Throws:
IllegalArgumentException- If an exception occurred.
-
parseArgs
Parse the Metric specific command line arguments.- Parameters:
params- ParsedOptions containing driver/logger specific parameters/arguments.- Throws:
IllegalArgumentException- If an exception occurred.
-
open
void open(ParsedOptions params, String storageName, Action action, io.time.Time time) throws IOException Open the Logger.- 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
Close the Logger.- Parameters:
params- ParsedOptions used during open; may carry shutdown options.- Throws:
IOException- If an exception occurred.
-
setExceptionHandler
default void setExceptionHandler(io.perl.exception.ExceptionHandler handler) Default implementation for setting exception handler. if the logger encounters any exception, it can report to SBK.- Parameters:
handler- Exception handler
-
reportFailure
Reports a terminal benchmark failure before the logger transport is closed.Implementations that do not provide a control-plane transport may retain this no-op. Reporting must be best effort and must not replace the original benchmark exception.
- Parameters:
failure- terminal benchmark failure
-