biz.hammurapi.metrics
Class SimpleSlice

java.lang.Object
  extended by biz.hammurapi.metrics.SimpleSlice
All Implemented Interfaces:
Metric, Slice, DomSerializable, java.io.Serializable

public class SimpleSlice
extends java.lang.Object
implements Slice, java.io.Serializable, DomSerializable

Version:
$Revision: 1.4 $
Author:
Pavel Vlasov
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface biz.hammurapi.metrics.Metric
Metric.Measurement
 
Constructor Summary
SimpleSlice(Slice master)
          Constructs a copy of master slice.
SimpleSlice(java.lang.String name)
           
SimpleSlice(java.lang.String name, boolean keepMeasurements)
           
 
Method Summary
 void add(double value, long time)
          Adds measurement
 void add(Metric metric)
          Adds another metric (aggregates)
 int compareTo(java.lang.Object o)
           
 double getAvg()
           
 double getDeviation()
           
 long getFrom()
           
 double getMax()
           
 java.util.Collection getMeasurements()
           
 double getMin()
           
 java.lang.String getName()
           
 int getNumber()
           
 long getTo()
           
 double getTotal()
           
 void toDom(org.w3c.dom.Element holder)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleSlice

public SimpleSlice(java.lang.String name)

SimpleSlice

public SimpleSlice(java.lang.String name,
                   boolean keepMeasurements)

SimpleSlice

public SimpleSlice(Slice master)
Constructs a copy of master slice.

Parameters:
master -
Method Detail

getNumber

public int getNumber()
Specified by:
getNumber in interface Metric
Returns:
number of measurements

getMin

public double getMin()
Specified by:
getMin in interface Metric
Returns:
Minimum value

getMax

public double getMax()
Specified by:
getMax in interface Metric
Returns:
Maximum value

getAvg

public double getAvg()
Specified by:
getAvg in interface Metric
Returns:
Average

getTotal

public double getTotal()
Specified by:
getTotal in interface Metric
Returns:
Sum of values from all measurements

add

public void add(double value,
                long time)
Description copied from interface: Metric
Adds measurement

Specified by:
add in interface Metric
Parameters:
value - value

add

public void add(Metric metric)
Description copied from interface: Metric
Adds another metric (aggregates)

Specified by:
add in interface Metric

getMeasurements

public java.util.Collection getMeasurements()
Specified by:
getMeasurements in interface Metric
Returns:
Collection of Metric.Measurement

getName

public java.lang.String getName()
Specified by:
getName in interface Metric

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

compareTo

public int compareTo(java.lang.Object o)

getFrom

public long getFrom()
Specified by:
getFrom in interface Slice
Returns:
Slice start time

getTo

public long getTo()
Specified by:
getTo in interface Slice
Returns:
Slice end time

getDeviation

public double getDeviation()
Specified by:
getDeviation in interface Metric
Returns:
average distance from average

toDom

public void toDom(org.w3c.dom.Element holder)
Specified by:
toDom in interface DomSerializable


Copyright © 2003 Hammurapi Group. All Rights Reserved.