Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.jetty.util.statistic
Class SampleStatistic

    java.lang.Object
      org.eclipse.jetty.util.statistic.SampleStatistic

    public class SampleStatistic

extends java.lang.Object

SampledStatistics

Provides max, total, mean, count, variance, and standard deviation of continuous sequence of samples.

Calculates estimates of mean, variance, and standard deviation characteristics of a sample using a non synchronized approximation of the on-line algorithm presented in Donald Knuth's Art of Computer Programming, Volume 2, Seminumerical Algorithms, 3rd edition, page 232, Boston: Addison-Wesley. that cites a 1962 paper by B.P. Welford that can be found by following the link http://www.jstor.org/pss/1266577

This algorithm is also described in Wikipedia at http://en.wikipedia.org/w/index.php?title=Algorithms_for_calculating_variance§ion=4#On-line_algorithm

Field Summary
`protected java.util.concurrent.atomic.AtomicLong` | `_count`
`protected java.util.concurrent.atomic.AtomicLong` | `_max`
`protected java.util.concurrent.atomic.AtomicLong` | `_total`
`protected java.util.concurrent.atomic.AtomicLong` | `_totalVariance100`

Constructor Summary
`SampleStatistic()`

Method Summary
`long` | `getCount()`
`long` | `getMax()`
`double` | `getMean()`
`double` | `getStdDev()`
`long` | `getTotal()`
`double` | `getVariance()`
`void` | `reset()`
`void` | `set(long sample)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### _max

    protected final java.util.concurrent.atomic.AtomicLong _max

### _total

    protected final java.util.concurrent.atomic.AtomicLong _total

### _count

    protected final java.util.concurrent.atomic.AtomicLong _count

### _totalVariance100

    protected final java.util.concurrent.atomic.AtomicLong _totalVariance100

Constructor Detail

### SampleStatistic

    public SampleStatistic()

Method Detail

### reset

    public void reset()

### set

    public void set(long sample)

### getMax

    public long getMax()

  Returns:
    the max value

### getTotal

    public long getTotal()

### getCount

    public long getCount()

### getMean

    public double getMean()

### getVariance

    public double getVariance()

### getStdDev

    public double getStdDev()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1995-2010 Mort Bay Consulting. All Rights Reserved.