com.sun.faban.driver.util.timermeter
Class CommonUtilities
java.lang.Object
com.sun.faban.driver.util.timermeter.CommonUtilities
public class CommonUtilities
- extends Object
Method Summary |
static List<MeasurementGroupsCluster> |
clusterTimerValuesFromHistogram(SortedMap<Long,Integer> allMeasurementsHistogram,
int clusterFormationThresholdDistance)
TODO move back to AbstractTimerMeter and rename to show this method's specific nature
Sketch of work for threshold==2 ("entry" := one element of
allMeasurementsHistogram ):
if a cluster with 3 elements (i.e. |
static long |
computeAccuracyFromClusters(List<MeasurementGroupsCluster> clusters,
boolean verbose)
TODO document me please
TODO replace through greatest-common-divisor scheme (or add it testwise...) |
static StatisticalDescription |
computeCharacteristics_detailed(long[] measurements,
boolean logValues)
|
static SortedMap<Long,Integer> |
computeHistogram(long[] measurements)
TODO test me!
Computes a simple sorted histogram from measurements |
static void |
rearrangeMeasurementsByValue(SortedMap<Integer,SortedMap<Long,Integer>> source,
SortedMap<Long,SortedMap<Integer,Integer>> destination)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CommonUtilities
public CommonUtilities()
rearrangeMeasurementsByValue
public static void rearrangeMeasurementsByValue(SortedMap<Integer,SortedMap<Long,Integer>> source,
SortedMap<Long,SortedMap<Integer,Integer>> destination)
- Parameters:
source
- destination
-
clusterTimerValuesFromHistogram
public static List<MeasurementGroupsCluster> clusterTimerValuesFromHistogram(SortedMap<Long,Integer> allMeasurementsHistogram,
int clusterFormationThresholdDistance)
- TODO move back to AbstractTimerMeter and rename to show this method's specific nature
Sketch of work for threshold==2 ("entry" := one element of
allMeasurementsHistogram
):
if a cluster with 3 elements (i.e. x, x+1, x+2) appears:
re-visit existing clusters and break them into one-entry-per-cluster
(or, simpler: discard existing clusters and re-traverse
allMeasurementsHistogram
with a threshold of <1).
The return of this method should be postprocessed by another method
that computes the accuracy as greatest common divisor of cluster
distances. However, this is tricky, as some two-classes clusters may
not have any values from one class, e.g. [(100,101), (200,201), (300), (400,401)],
or some classes may have been skipped altogether...
Just work with "+-1" cluster distances (this does not work with "2" or
other small accuracies)? Or should we "fill" non-existing classes?
In fact, we cannot guarantee that all classes are present...
For future work: can we make any statements about the "Nachkommastelle"
from the frequencies of the classes?
- Parameters:
allMeasurementsHistogram
- clusterFormationThresholdDistance
- the maximum distance (incl.)
from the leftmost [smalles] element of the current cluster
so that the considered allMeasurementsHistogram
entry
can still be added to the current cluster.
- Returns:
computeAccuracyFromClusters
public static long computeAccuracyFromClusters(List<MeasurementGroupsCluster> clusters,
boolean verbose)
- TODO document me please
TODO replace through greatest-common-divisor scheme (or add it testwise...)
- Parameters:
clusters
-
- Returns:
computeCharacteristics_detailed
public static StatisticalDescription computeCharacteristics_detailed(long[] measurements,
boolean logValues)
- Parameters:
measurements
- logValues
-
- Returns:
- TODO test me
TODO set all fields!
computeHistogram
public static SortedMap<Long,Integer> computeHistogram(long[] measurements)
- TODO test me!
Computes a simple sorted histogram from
measurements
- Parameters:
measurements
- the input
- Returns:
- the resulting histogram