silk.performer
Class MeasureCounter


java.lang.Object

  extended bysilk.performer.MeasureCounter


public final class MeasureCounter
extends java.lang.Object

Represents a custom counter. Use objects of that class instead of MesureInc() and MeasureIncFloat() of the SilkPerformer class.

See Also:
MeasureTimer

Constructor Summary
MeasureCounter(java.lang.String name, SilkPerformer spContext)
          Creates a new custom counter without a metric unit string at first position of the counter list.
MeasureCounter(java.lang.String name, java.lang.String unit, int usage, int idx, SilkPerformer spContext)
          Creates a new custom counter.
MeasureCounter(java.lang.String name, java.lang.String unit, int usage, SilkPerformer spContext)
          Creates a new custom counter at first position of the counter list.
MeasureCounter(java.lang.String name, java.lang.String unit, SilkPerformer spContext)
          Creates a new custom counter at first position of the counter list.
 
Method Summary
 int getIdx()
          Returns the counter list index of that object.
 java.lang.String getName()
          Returns the name of the counter.
 java.lang.String getUnit()
          Returns the metric unit of the counter.
 int getUsage()
          Returns the usage of the counter, see also MEASURE_USAGE_ options of SilkPerformer class.
 double inc()
          Increments the counter by 1 and returns the current value (sum or average, see usage).
 double inc(double value)
          Increments the counter by a value and returns the current value (sum or average, see usage).
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MeasureCounter


public MeasureCounter(java.lang.String name,
                      SilkPerformer spContext)
Creates a new custom counter without a metric unit string at first position of the counter list. Usage is set to MEASURE_USAGE_SUM_COUNTER per default, but you can display such a counter also as average later in the PerformanceExplorer.

Parameters:
name - Counter name, used to identify the measure in output.
spContext - The SilkPerformer object of your framework class.

MeasureCounter


public MeasureCounter(java.lang.String name,
                      java.lang.String unit,
                      SilkPerformer spContext)
Creates a new custom counter at first position of the counter list. Usage is set to MEASURE_USAGE_SUM_COUNTER per default, but you can display such a counter also as average later in the PerformanceExplorer.

Parameters:
name - Counter name, used to identify the measure in output.
unit - Metric unit string, will be used from PerformanceExplorer for output.
spContext - The SilkPerformer object of your framework class.

MeasureCounter


public MeasureCounter(java.lang.String name,
                      java.lang.String unit,
                      int usage,
                      SilkPerformer spContext)
Creates a new custom counter at first position of the counter list.

Parameters:
name - Counter name, used to identify the measure in output.
unit - Metric unit string, will be used from PerformanceExplorer for output.
usage - Determines how the measure series will be displayed per default in the PerformanceExplorer, see MEASURE_USAGE_ options of SilkPerformer class.
spContext - The SilkPerformer object of your framework class.

MeasureCounter


public MeasureCounter(java.lang.String name,
                      java.lang.String unit,
                      int usage,
                      int idx,
                      SilkPerformer spContext)
Creates a new custom counter.

Parameters:
name - Counter name, used to identify the measure in output.
unit - Metric unit string, will be used from PerformanceExplorer for output.
usage - Determines how the measure series will be displayed per default in the PerformanceExplorer, see MEASURE_USAGE_ options of SilkPerformer class.
idx - Index in the counter list, use it for real time monitoring with PerformanceExplorer.
spContext - The SilkPerformer object of your framework class.
Method Detail

inc


public double inc()
           throws SilkPerformerException
Increments the counter by 1 and returns the current value (sum or average, see usage).

Throws:
SilkPerformerException

inc


public double inc(double value)
           throws SilkPerformerException
Increments the counter by a value and returns the current value (sum or average, see usage).

Parameters:
value - Value to increment.
Throws:
SilkPerformerException

getName


public java.lang.String getName()
Returns the name of the counter.


getUnit


public java.lang.String getUnit()
Returns the metric unit of the counter.


getUsage


public int getUsage()
Returns the usage of the counter, see also MEASURE_USAGE_ options of SilkPerformer class.


getIdx


public int getIdx()
Returns the counter list index of that object.


toString


public java.lang.String toString()