java.lang.Object
org.noise_planet.noisemodelling.pathfinder.utils.profiler.ProfilerThread
All Implemented Interfaces:
Runnable

public class ProfilerThread extends Object implements Runnable
  • Field Details

    • log

      public org.slf4j.Logger log
    • timeTracker

      public AtomicLong timeTracker
  • Constructor Details

    • ProfilerThread

      public ProfilerThread(File outputFile)
  • Method Details

    • addMetric

      public void addMetric(ProfilerThread.Metric metric)
      add this given metric (collection of statistics to write on the profile csv file)
      Parameters:
      metric -
    • setWriteInterval

      public void setWriteInterval(int writeInterval)
      Parameters:
      writeInterval - In seconds, intervals for writing new metrics in the csv file
    • setFlushInterval

      public void setFlushInterval(int flushInterval)
      Parameters:
      flushInterval - Time in seconds between each effective write on the hard drive
    • run

      public void run()
      Runs the thread to continuously write metric data to the output file.Runs the thread to continuously write metric data to the output file.
      Specified by:
      run in interface Runnable
    • stop

      public void stop()
    • getMetric

      public <T extends ProfilerThread.Metric> T getMetric(Class<T> metricClass)
      Type Parameters:
      T -
      Parameters:
      metricClass -
      Returns: