Class ProcessTime

java.lang.Object
net.simplace.sim.util.analytics.ProcessTime

public class ProcessTime extends Object
Runtime statistics of a component or adapter: sum, maximum and count of the measured processing times in milliseconds. Times are only recorded if the measurement is switched on (FWConstants.PROCESS_TIME).
Author:
aenders
  • Constructor Details

    • ProcessTime

      public ProcessTime(String aName)
      Parameters:
      aName - name of the component
  • Method Details

    • getSum

      public long getSum()
      Returns:
      the sum of the measured times in ms
    • getMean

      public long getMean()
      Returns:
      the mean of the measured times in ms (the sum if nothing was measured)
    • getMax

      public long getMax()
      Returns:
      the maximum measured time in ms
    • getCount

      public int getCount()
      Returns:
      the number of measurements
    • add

      public void add(long aProcessTime)
      Adds a measured time, if the measurement is switched on. Synchronized, as simulations running in parallel share the process time of a component.
      Parameters:
      aProcessTime - the measured time in ms
    • getName

      public String getName()
      Returns:
      the name of the component
    • reset

      public void reset()
      Resets sum, maximum and count.
    • toString

      public String toString()
      Returns mean, max and sum as text.
      Overrides:
      toString in class Object
      See Also: