MetroCollect  2.3.4
MetroCollect::Statistics Class Reference

Class holding various statistics-related types and variables. More...

#include <Statistics.h>

Collaboration diagram for MetroCollect::Statistics:

Public Types

enum  Stats : uint64_t {
  StatsMin = 1 << StatsIndexMin, StatsMax = 1 << StatsIndexMax, StatsAverage = 1 << StatsIndexAverage, StatsStdDev = 1 << StatsIndexStdDev,
  StatsNone = 0, StatsAll = StatsMin | StatsMax | StatsAverage | StatsStdDev
}
 Bitwise type te select statistics. More...
 

Static Public Member Functions

static Stats statsFromName (const std::string_view &statName)
 Convert a stat name to a stat value. More...
 
static Stats statsRequiredForStat (Stats stat)
 Returns the stats which are required to compute this stat. More...
 

Static Public Attributes

static constexpr size_t count = 4
 Number of available statistics. More...
 
static constexpr std::array< std::string_view, countnames = {"min"sv, "max"sv, "average"sv, "stdDev"sv}
 Names of available statistics. More...
 
static constexpr std::string_view nameStatsAll = "*"sv
 
static constexpr std::array< Stats, countallStats = {StatsMin, StatsMax, StatsAverage, StatsStdDev}
 Array of all available statistics. More...
 

Protected Types

enum  StatsIndex : uint8_t {
  StatsIndexMin = 0, StatsIndexMax = 1, StatsIndexAverage = 2, StatsIndexStdDev = 3,
  StatsIndexIntermediateSum = 4, StatsIndexIntermediateSumSquared = 5
}
 Associates a unique index to each statistic. More...
 
enum  StatsDependency : uint64_t {
  StatsDependencyMin = StatsMin, StatsDependencyMax = StatsMax, StatsDependencyStdDev = StatsStdDev, StatsDependencyAverage = StatsAverage | StatsDependencyStdDev,
  StatsDependencySum = StatsDependencyAverage, StatsDependencySumSquared = StatsDependencyStdDev
}
 Dependency tree of each statistic. More...
 

Static Protected Attributes

static constexpr size_t extraCount = count + 2
 Number of statistics and intermediate values. More...
 
static constexpr std::array< StatsDependency, extraCountStatsDependencies = {StatsDependencyMin, StatsDependencyMax, StatsDependencyAverage, StatsDependencyStdDev, StatsDependencySum, StatsDependencySumSquared}
 Array of all statistics dependencies. More...
 

Private Attributes

friend MetricsController
 MetricsController can access to protected types and variables. More...
 

Detailed Description

Class holding various statistics-related types and variables.

Definition at line 35 of file Statistics.h.

Member Enumeration Documentation

◆ Stats

Bitwise type te select statistics.

Enumerator
StatsMin 

Minimum.

StatsMax 

Maximum.

StatsAverage 

Average.

StatsStdDev 

Standard deviation.

StatsNone 

No statistics selected.

StatsAll 

All statistics selected.

Definition at line 64 of file Statistics.h.

◆ StatsDependency

enum MetroCollect::Statistics::StatsDependency : uint64_t
protected

Dependency tree of each statistic.

Enumerator
StatsDependencyMin 

Statistics which require to compute minimum.

StatsDependencyMax 

Statistics which require to compute maximum.

StatsDependencyStdDev 

Statistics which require to compute standard deviation.

StatsDependencyAverage 

Statistics which require to compute average.

StatsDependencySum 

Statistics which require to compute sum.

StatsDependencySumSquared 

Statistics which require to compute sum of squares.

Definition at line 84 of file Statistics.h.

◆ StatsIndex

enum MetroCollect::Statistics::StatsIndex : uint8_t
protected

Associates a unique index to each statistic.

There are two kinds of statistics:

  • public statistics that can be computed and published as metrics
  • private intermediate statistics that are only used to compute other statistics
Enumerator
StatsIndexMin 

Minimum.

StatsIndexMax 

Maximum.

StatsIndexAverage 

Average.

StatsIndexStdDev 

Standard deviation.

StatsIndexIntermediateSum 

Sum of value (intermediate statistic)

StatsIndexIntermediateSumSquared 

Sum of squares of values (intermediate statistic)

Definition at line 45 of file Statistics.h.

Member Function Documentation

◆ statsFromName()

Statistics::Stats MetroCollect::Statistics::statsFromName ( const std::string_view &  statName)
static

Convert a stat name to a stat value.

Definition at line 349 of file MetricsController.cc.

Here is the caller graph for this function:

◆ statsRequiredForStat()

Statistics::Stats MetroCollect::Statistics::statsRequiredForStat ( Stats  stat)
static

Returns the stats which are required to compute this stat.

Definition at line 361 of file MetricsController.cc.

Here is the caller graph for this function:

Member Data Documentation

◆ allStats

constexpr std::array<Stats, count> MetroCollect::Statistics::allStats = {StatsMin, StatsMax, StatsAverage, StatsStdDev}
static

Array of all available statistics.

Definition at line 73 of file Statistics.h.

◆ count

constexpr size_t MetroCollect::Statistics::count = 4
static

Number of available statistics.

Definition at line 57 of file Statistics.h.

◆ extraCount

constexpr size_t MetroCollect::Statistics::extraCount = count + 2
staticprotected

Number of statistics and intermediate values.

Definition at line 79 of file Statistics.h.

◆ MetricsController

friend MetroCollect::Statistics::MetricsController
private

MetricsController can access to protected types and variables.

Definition at line 36 of file Statistics.h.

◆ names

constexpr std::array<std::string_view, count> MetroCollect::Statistics::names = {"min"sv, "max"sv, "average"sv, "stdDev"sv}
static

Names of available statistics.

Definition at line 58 of file Statistics.h.

◆ nameStatsAll

constexpr std::string_view MetroCollect::Statistics::nameStatsAll = "*"sv
static

Definition at line 59 of file Statistics.h.

◆ StatsDependencies

constexpr std::array<StatsDependency, extraCount> MetroCollect::Statistics::StatsDependencies = {StatsDependencyMin, StatsDependencyMax, StatsDependencyAverage, StatsDependencyStdDev, StatsDependencySum, StatsDependencySumSquared}
staticprotected

Array of all statistics dependencies.

Definition at line 92 of file Statistics.h.


The documentation for this class was generated from the following files: