ganeti

Safe HaskellSafe-Infered

Ganeti.Utils.Statistics

Description

Utility functions for statistical accumulation.

Synopsis

Documentation

type TagTagMap = Map (String, String) IntSource

Type to store the number of instances for each exclusion and location pair. This is necessary to calculate second component of location score.

data Statistics Source

Abstract type of statistical accumulations. They behave as if the given statistics were computed on the list of values, but they allow a potentially more efficient update of a given value.

Constructors

SumStatistics Double 
StdDevStatistics Double Double Double 
MapStatistics TagTagMap 

Instances

Show Statistics 

data AggregateComponent Source

Abstract type of per-node statistics measures. The SimpleNumber is used to construct SumStatistics and StdDevStatistics while SpreadValues is used to construct MapStatistics.

Constructors

SimpleNumber Double 
SpreadValues TagTagMap 

getSumStatistics :: [AggregateComponent] -> StatisticsSource

Get a statistics that sums up the values.

getStdDevStatistics :: [AggregateComponent] -> StatisticsSource

Get a statistics for the standard deviation.

getMapStatistics :: [AggregateComponent] -> StatisticsSource

Get a statistics for the standard deviation.

getStatisticValue :: Statistics -> DoubleSource

Obtain the value of a statistics.

updateStatistics :: Statistics -> (AggregateComponent, AggregateComponent) -> StatisticsSource

In a given statistics replace on value by another. This will only give meaningful results, if the original value was actually part of the statistics.