com.kuka.common
Class StatisticTimer

java.lang.Object
  extended by com.kuka.common.StatisticTimer

public class StatisticTimer
extends Object

Usage of the Statistic Timer for periodic cyclic timing measurements Typical operation

This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

Nested Class Summary
 class StatisticTimer.OneTimeStep
          Inner Sampling Class.
 
Field Summary
protected  boolean _flagDetailedString
          Detailing of Output - controls the toText function.
 
Constructor Summary
StatisticTimer()
          Creates a new instance of StatisticTimer.
StatisticTimer(int nCallsInit, long minTimeInit, long maxTimeInit, long sumTimeInit, double sumSquaredTimeInit)
          Creates a new instance of StatisticTimer with initial conditions to reinitialize statistics.
 
Method Summary
 long getMaxTime()
          get the Maximum sample time in nanoseconds of all samples.
 double getMaxTimeMillis()
          Get the minimum Sample time in milliseconds.
 double getMeanTime()
          Gets mean time.
 double getMeanTimeMillis()
          Get the mean of all squared Sample times in milliseconds.
 long getMinTime()
          get the Minimum sample time in nanoseconds of all samples.
 double getMinTimeMillis()
          Get the minimum Sample time in milliseconds.
 int getNCalls()
          get the number of samples.
 long getStdDevTime()
          Gets the statistic standard deviation in nanoseconds.
 double getStdDevTimeMillis()
          Get the Statistic Standard Deviation of all Sample times in milliseconds.
 double getSumSquaredTime()
          get the squared time in nanoseconds.
 double getSumSquaredTimeMillis()
          Get the Sum of all squared Sample times in milliseconds.
 long getSumTime()
          get the sum of all time samples.
 double getSumTimeMillis()
          Get the Sum of all Sample times in milliseconds.
 StatisticTimer mergeMeasurement(StatisticTimer inst)
          Merges the measurement of another instance to this instance.
 StatisticTimer.OneTimeStep newTimeStep()
          Start the measurement of one new sample When timing measurement of this sample shall end, call OneTimeStep.end().
protected static double toMillis(double timeInNanos)
          Function to convert nanoseconds in milliseconds.
protected static double toMillis(long timeInNanos)
          Function to convert nanoseconds in milliseconds.
 String toString()
          serialize contents to a string the output can be detailed when activateDetailedOutput() is set to true.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_flagDetailedString

protected boolean _flagDetailedString
Detailing of Output - controls the toText function.

Constructor Detail

StatisticTimer

public StatisticTimer()
Creates a new instance of StatisticTimer. Standard access.


StatisticTimer

public StatisticTimer(int nCallsInit,
                      long minTimeInit,
                      long maxTimeInit,
                      long sumTimeInit,
                      double sumSquaredTimeInit)
Creates a new instance of StatisticTimer with initial conditions to reinitialize statistics.

Parameters:
nCallsInit - initial number of calls.
minTimeInit - initial minTime.
maxTimeInit - initial
sumTimeInit - initial
sumSquaredTimeInit - initial
Method Detail

mergeMeasurement

public StatisticTimer mergeMeasurement(StatisticTimer inst)
Merges the measurement of another instance to this instance.

Parameters:
inst - the instance to merge
Returns:
this instance, which is enriched by the measurement information of the other instance

getNCalls

public int getNCalls()
get the number of samples.

Returns:
the number of calls.

getMinTime

public long getMinTime()
get the Minimum sample time in nanoseconds of all samples.

Returns:
long - minimum sample time in nanoseconds.

getMinTimeMillis

public double getMinTimeMillis()
Get the minimum Sample time in milliseconds.

Returns:
the minimum Sample time in milliseconds.

getMaxTime

public long getMaxTime()
get the Maximum sample time in nanoseconds of all samples.

Returns:
the Maximum sample time in nanoseconds of all samples.

getMaxTimeMillis

public double getMaxTimeMillis()
Get the minimum Sample time in milliseconds.

Returns:
the minimum Sample time in milliseconds.

getSumTime

public long getSumTime()
get the sum of all time samples.

Returns:
long - sum of all samples in nanoSeconds.

getSumTimeMillis

public double getSumTimeMillis()
Get the Sum of all Sample times in milliseconds.

Returns:
the Sum of all Sample times in milliseconds.

getSumSquaredTime

public double getSumSquaredTime()
get the squared time in nanoseconds.

Returns:
the squared time in nanoseconds.

getSumSquaredTimeMillis

public double getSumSquaredTimeMillis()
Get the Sum of all squared Sample times in milliseconds.

Returns:
the Sum of all squared Sample times in milliseconds as base of standard-deviation.

getMeanTime

public double getMeanTime()
Gets mean time.

Returns:
0 - if no sample is there, else the mean in NanoSeconds

getMeanTimeMillis

public double getMeanTimeMillis()
Get the mean of all squared Sample times in milliseconds.

Returns:
the mean of all squared Sample times in milliseconds.

getStdDevTime

public long getStdDevTime()
Gets the statistic standard deviation in nanoseconds.

Returns:
The statistic standard deviation in nanoseconds.

getStdDevTimeMillis

public double getStdDevTimeMillis()
Get the Statistic Standard Deviation of all Sample times in milliseconds.

Returns:
the Statistic Standard Deviation of all Sample times in milliseconds.

toMillis

protected static double toMillis(double timeInNanos)
Function to convert nanoseconds in milliseconds.

Parameters:
timeInNanos - - time in nanoseconds double !!
Returns:
double value in milliseconds.

toMillis

protected static double toMillis(long timeInNanos)
Function to convert nanoseconds in milliseconds.

Parameters:
timeInNanos - - time in nanoseconds long !!
Returns:
double value in milliseconds.

toString

public String toString()
serialize contents to a string the output can be detailed when activateDetailedOutput() is set to true.

Overrides:
toString in class Object
Returns:
Text of inner states wrt milli seconds.

newTimeStep

public StatisticTimer.OneTimeStep newTimeStep()
Start the measurement of one new sample When timing measurement of this sample shall end, call OneTimeStep.end().

Returns:
Instance of "OneTimeStep"


Copyright © 2019. All rights reserved.