MySQL 26.10.0
Source Code Documentation
hm::ds::Storage_State Class Reference

#include <health_monitor_disk_state.h>

Inheritance diagram for hm::ds::Storage_State:
[legend]

Public Types

enum  State {
  UNDEF , START , STOP , NORMAL ,
  WARNING , LOW_LIMIT , CRITICAL , RECOVERY_1 ,
  RECOVERY_2 , ERROR
}
 

Public Member Functions

 Storage_State ()=default
 
 Storage_State (const char *state_name, State state)
 
virtual ~Storage_State ()=default
 
virtual void enter ()
 
virtual void check_levels ()
 
virtual void exit ()
 
enum State state () const
 

Static Public Member Functions

static void set_collector (Disk_Collector *collector)
 
static void get_params ()
 Storage State - Get params Get the storage threshold params from the disk collector. More...
 
static void get_levels ()
 Storage State - Get levels Get the storage levels from the disk collector. More...
 
static bool normal_level ()
 Storage State - Storage levels. More...
 
static bool warning_level ()
 
static bool low_level ()
 
static bool critical_level ()
 
static bool disk_error ()
 
static void set_normal_state ()
 Storage State - Transitions. More...
 
static void set_warning_state ()
 
static void set_low_limit_state ()
 
static void set_critical_state ()
 
static void set_error_state ()
 

Static Public Attributes

static Disk_Collector * dc {nullptr}
 
static size_t available_mb {0}
 
static size_t reserve_mb {0}
 
static size_t critical_level_mb {0}
 
static size_t warn_level_1_mb {0}
 
static size_t warn_level_2_mb {0}
 
static size_t warn_level_3_mb {0}
 
static size_t max_warn_level_mb {0}
 
static size_t recovery_level_mb {0}
 

Private Attributes

const std::string m_name
 
State m_state {UNDEF}
 

Member Enumeration Documentation

◆ State

Enumerator
UNDEF 
START 
STOP 
NORMAL 
WARNING 
LOW_LIMIT 
CRITICAL 
RECOVERY_1 
RECOVERY_2 
ERROR 

Constructor & Destructor Documentation

◆ Storage_State() [1/2]

hm::ds::Storage_State::Storage_State ( )
default

◆ Storage_State() [2/2]

hm::ds::Storage_State::Storage_State ( const char *  state_name,
State  state 
)
inline

◆ ~Storage_State()

virtual hm::ds::Storage_State::~Storage_State ( )
virtualdefault

Member Function Documentation

◆ check_levels()

virtual void hm::ds::Storage_State::check_levels ( )
inlinevirtual

◆ critical_level()

bool hm::Storage_State::critical_level ( )
static

◆ disk_error()

bool hm::Storage_State::disk_error ( )
static

◆ enter()

virtual void hm::ds::Storage_State::enter ( )
inlinevirtual

◆ exit()

virtual void hm::ds::Storage_State::exit ( )
inlinevirtual

◆ get_levels()

void hm::Storage_State::get_levels ( )
static

Storage State - Get levels Get the storage levels from the disk collector.

◆ get_params()

void hm::Storage_State::get_params ( )
static

Storage State - Get params Get the storage threshold params from the disk collector.

These are set once a valid mount point is established.

◆ low_level()

bool hm::Storage_State::low_level ( )
static

◆ normal_level()

bool hm::Storage_State::normal_level ( )
static

Storage State - Storage levels.

Storage levels are intended to be logically sequential such that normal > warning 1 > warning 2 > warning 3 > low > critical, however they can be defined in any order. To ensure logical consistency, each level has a primary definition with zero or more qualifiers.

For example, low level always means that available space is below the reserve level, but must also be above the critical level, even if the critical level is set to be higher than the reserve, as some test cases do.

◆ set_collector()

static void hm::ds::Storage_State::set_collector ( Disk_Collector *  collector)
inlinestatic

◆ set_critical_state()

void hm::Storage_State::set_critical_state ( )
static

◆ set_error_state()

void hm::Storage_State::set_error_state ( )
static

◆ set_low_limit_state()

void hm::Storage_State::set_low_limit_state ( )
static

◆ set_normal_state()

void hm::Storage_State::set_normal_state ( )
static

Storage State - Transitions.

◆ set_warning_state()

void hm::Storage_State::set_warning_state ( )
static

◆ state()

enum State hm::ds::Storage_State::state ( ) const
inline

◆ warning_level()

bool hm::Storage_State::warning_level ( )
static

Member Data Documentation

◆ available_mb

size_t hm::Storage_State::available_mb {0}
static

◆ critical_level_mb

size_t hm::Storage_State::critical_level_mb {0}
static

◆ dc

Disk_Collector * hm::Storage_State::dc {nullptr}
static

◆ m_name

const std::string hm::ds::Storage_State::m_name
private

◆ m_state

State hm::ds::Storage_State::m_state {UNDEF}
private

◆ max_warn_level_mb

size_t hm::Storage_State::max_warn_level_mb {0}
static

◆ recovery_level_mb

size_t hm::Storage_State::recovery_level_mb {0}
static

◆ reserve_mb

size_t hm::Storage_State::reserve_mb {0}
static

◆ warn_level_1_mb

size_t hm::Storage_State::warn_level_1_mb {0}
static

◆ warn_level_2_mb

size_t hm::Storage_State::warn_level_2_mb {0}
static

◆ warn_level_3_mb

size_t hm::Storage_State::warn_level_3_mb {0}
static

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