Package io.perl.api

Interface PerlChannel

All Superinterfaces:
ExceptionHandler

public interface PerlChannel extends ExceptionHandler
A dedicated channel used by a single thread to submit benchmarking events to a PerL instance. The channel collects start/end timestamps and the number of records and bytes and forwards them to the PerL internals for aggregation.

Thread-safety: Instances of PerlChannel are NOT thread-safe and each worker thread should obtain its own channel via GetPerlChannel.getPerlChannel().

Implementations may throw/handle exceptions via ExceptionHandler. Example usage:

 
 PerlChannel channel = perl.getPerlChannel();
 long start = System.nanoTime();
 // perform work
 long end = System.nanoTime();
 channel.send(start, end, 1, payloadSize);
 
 
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    send(long startTime, long endTime, int records, int bytes)
    Send benchmarking data for aggregation.

    Methods inherited from interface io.perl.exception.ExceptionHandler

    throwException
  • Method Details

    • send

      void send(long startTime, long endTime, int records, int bytes)
      Send benchmarking data for aggregation.
      Parameters:
      startTime - Start time (caller-defined time unit; typically nanoseconds)
      endTime - End time (caller-defined time unit)
      records - number of records/events/messages represented by this entry
      bytes - size of the data in bytes