com.sun.sgs.impl.profile.util
Interface Histogram

All Known Implementing Classes:
LinearHistogram, PowerOfTwoHistogram

public interface Histogram

A data aggregation with utility methods for converting the internal representations to text. A histogram takes in arbitrary data samples and keeps track of the distributions and count of samples seen. Each histogram should be considered a view on the data itself, not a collection of the data.


Method Summary
 void bin(long value)
          Updates the state of the histogram by finding the appropriate bin for the provided value and then incrementing the number of samples seen for that bin.
 void clear()
          Clears the internal state of the histogram, removing all collected samples.
 int size()
          Returns the number of samples represented by this histogram.
 String toString()
          Returns a text-based representation of this histogram.
 String toString(String binLabel)
          Returns a text-based representation of this histogram where each of the bins has the provided label.
 

Method Detail

bin

void bin(long value)
Updates the state of the histogram by finding the appropriate bin for the provided value and then incrementing the number of samples seen for that bin.

Parameters:
value - the value to be aggregated

clear

void clear()
Clears the internal state of the histogram, removing all collected samples.


size

int size()
Returns the number of samples represented by this histogram.

Returns:
the number of samples represented by this hisogram

toString

String toString()
Returns a text-based representation of this histogram.

Overrides:
toString in class Object
Returns:
a text-based representation of this histogram

toString

String toString(String binLabel)
Returns a text-based representation of this histogram where each of the bins has the provided label. This method allows for attaching a name such as "bytes" or "ms" to the number values on each of the bins.

Parameters:
binLabel - the label to be appended to the name of each of the bins.
Returns:
a text based representation of this histogram

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved