Class DefaultLogger

java.lang.Object
io.perl.logger.impl.ResultsLogger
io.perl.logger.impl.DefaultLogger
All Implemented Interfaces:
PerformanceLogger, Print, ReportLatency
Direct Known Subclasses:
DefaultPrometheusLogger

public class DefaultLogger extends ResultsLogger
Simple textual results logger that prints the formatted summary to stdout.

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 Details

    • DefaultLogger

      public DefaultLogger(String header, double[] percentiles, TimeUnit latencyTimeUnit, long minLatency, long maxLatency)
      Constructor DefaultLogger pass all values to its super class.
      Parameters:
      header - String
      percentiles - double[]
      latencyTimeUnit - TimeUnit
      minLatency - long
      maxLatency - long
    • 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 time
      events - number of events represented by this measurement
      bytes - number of bytes represented by this measurement
      latency - measured latency
    • recordsIndividualLatencies

      public final boolean recordsIndividualLatencies()
      Description copied from interface: PerformanceLogger
      Indicates 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 return false, allowing PerL to omit the callback from its single-threaded measurement path.

      Returns:
      true when PerL must invoke recordLatency for every event