Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
Loading...
Searching...
No Matches
statistics.h File Reference

Generic statistics utilities for percentile calculations. More...

#include <algorithm>
#include <cmath>
#include <cstddef>
#include <numeric>
#include <type_traits>
#include <vector>
Include dependency graph for statistics.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  kcenon::monitoring::stats::statistics< T >
 Statistical summary for a collection of values. More...
 
struct  kcenon::monitoring::stats::detail::is_chrono_duration< T >
 Type trait to detect std::chrono::duration types. More...
 
struct  kcenon::monitoring::stats::detail::is_chrono_duration< std::chrono::duration< Rep, Period > >
 

Namespaces

namespace  kcenon
 
namespace  kcenon::monitoring
 
namespace  kcenon::monitoring::stats
 
namespace  kcenon::monitoring::stats::detail
 

Functions

template<typename T >
constexpr T kcenon::monitoring::stats::detail::zero_value ()
 Get zero value for a type.
 
template<typename T >
constexpr T kcenon::monitoring::stats::detail::max_value ()
 Get maximum value for a type.
 
template<typename T >
constexpr T kcenon::monitoring::stats::detail::min_value ()
 Get minimum (lowest) value for a type.
 
template<typename T >
kcenon::monitoring::stats::detail::divide (const T &value, size_t count)
 Divide value by count.
 
template<typename T >
kcenon::monitoring::stats::percentile (const std::vector< T > &sorted_values, double percentile_value)
 
template<typename T >
statistics< T > kcenon::monitoring::stats::compute_sorted (const std::vector< T > &sorted_values)
 Compute statistics from sorted values.
 
template<typename T >
statistics< T > kcenon::monitoring::stats::compute (const std::vector< T > &values)
 
template<typename T >
statistics< T > kcenon::monitoring::stats::compute_inplace (std::vector< T > &values)
 Compute statistics in place (modifies input)
 

Variables

template<typename T >
constexpr bool kcenon::monitoring::stats::detail::is_chrono_duration_v = is_chrono_duration<T>::value
 

Detailed Description

Generic statistics utilities for percentile calculations.

Date
2025

Provides reusable statistics calculation functions that can work with any numeric type, including std::chrono::nanoseconds and double.

Definition in file statistics.h.