|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object pt.digitalis.iss.ServiceStatistics
public final class ServiceStatistics
This class is a small statistics engine that calculates the estimated time for a request service. The method used tries to reduce the number of insertion operations performed on the container and iterations over it's elements. To achieve this, a method that sums groups of samples is used. Every incoming sample is added to a group total. When a certain number of samples is reached, the group total is summed to the absolute total, the group total is stored on the container (which also has it's oldest element removed) and the control variables reset.
Constructor Summary | |
---|---|
ServiceStatistics()
Constructor |
Method Summary | |
---|---|
void |
addSample(long sample)
Adds a new sample to the statistics engine. |
int |
getConfigElementsPerGroup()
Returns the defined number of elements in a group. |
int |
getConfigNumberOfGroups()
Returns the current number of groups. |
double |
getMeanExecutionTime()
Calculates the mean service time of a request from the available data. |
void |
reset()
This method enables that a client explicitly resets the stats engine. |
void |
setConfigElementsPerGroup(int groupElementNumber)
Sets the number of elements in a group. |
void |
setConfigNumberOfGroups(int numberOfGroups)
Sets the number of groups. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServiceStatistics()
Method Detail |
---|
public void addSample(long sample)
sample
- the new sample to addpublic double getMeanExecutionTime()
public int getConfigElementsPerGroup()
public void setConfigElementsPerGroup(int groupElementNumber)
groupElementNumber
- the configElementsPerGroup to setpublic int getConfigNumberOfGroups()
public void setConfigNumberOfGroups(int numberOfGroups)
numberOfGroups
- the numberOfGroups to setpublic void reset()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |