Logger System 0.1.3
High-performance C++20 thread-safe logging system with asynchronous capabilities
Loading...
Searching...
No Matches
kcenon::logger::sampling Namespace Reference

Classes

class  log_sampler
 Thread-safe log sampler with multiple strategy support. More...
 
class  sampler_factory
 Factory for creating pre-configured samplers. More...
 
struct  sampling_config
 Configuration for log sampling behavior. More...
 
struct  sampling_stats
 Statistics about sampling behavior. More...
 

Enumerations

enum class  sampling_strategy : std::uint8_t { random , rate_limiting , adaptive , hash_based }
 Defines the sampling algorithm to use. More...
 

Enumeration Type Documentation

◆ sampling_strategy

enum class kcenon::logger::sampling::sampling_strategy : std::uint8_t
strong

Defines the sampling algorithm to use.

Different strategies are suitable for different scenarios:

  • random: Simple probabilistic sampling, good for general use
  • rate_limiting: Ensures consistent log rate, good for burst protection
  • adaptive: Automatically adjusts based on load, good for variable workloads
  • hash_based: Deterministic sampling based on message hash, good for debugging
Since
3.3.0
Enumerator
random 

Simple random sampling based on probability.

rate_limiting 

Rate-based sampling (N logs per time window)

adaptive 

Adaptive sampling that adjusts based on volume.

hash_based 

Deterministic sampling based on message hash.

Examples
/home/runner/work/logger_system/logger_system/include/kcenon/logger/sampling/sampling_config.h.

Definition at line 50 of file sampling_config.h.

50 : std::uint8_t {
51 random,
53 adaptive,
55};
@ hash_based
Deterministic sampling based on message hash.
@ random
Simple random sampling based on probability.
@ rate_limiting
Rate-based sampling (N logs per time window)
@ adaptive
Adaptive sampling that adjusts based on volume.