Class PerformanceMonitor

java.lang.Object
opennlp.tools.cmdline.PerformanceMonitor

@Internal public class PerformanceMonitor extends Object
The PerformanceMonitor measures increments to a counter. During the computation it prints out current and average throughput per second. After the computation is done it prints a final performance report.

Note: This class is not thread safe.

Note: Do not use this class, internal use only!

  • Field Details

    • logger

      private static final org.slf4j.Logger logger
    • scheduler

      private final ScheduledExecutorService scheduler
    • unit

      private final String unit
    • beeperHandle

      private ScheduledFuture<?> beeperHandle
    • startTime

      private volatile long startTime
    • counter

      private volatile int counter
    • out

      private final PrintStream out
  • Constructor Details

    • PerformanceMonitor

      public PerformanceMonitor(PrintStream out, String unit)
    • PerformanceMonitor

      public PerformanceMonitor(String unit)
  • Method Details

    • isStarted

      public boolean isStarted()
    • incrementCounter

      public void incrementCounter(int increment)
    • incrementCounter

      public void incrementCounter()
    • start

      public void start()
    • startAndPrintThroughput

      public void startAndPrintThroughput()
    • stopAndPrintFinalResult

      public void stopAndPrintFinalResult()