#include <swcdb/common/sys/Resources.h>
Public Member Functions | |
SWC_SHOULD_NOT_INLINE | Resources (const Comm::IoContextPtr &ioctx, Config::Property::Value_int32_g::Ptr ram_percent_allowed, Config::Property::Value_int32_g::Ptr ram_percent_reserved, Config::Property::Value_int32_g::Ptr ram_release_rate, Notifier *notifier=nullptr, Mem::ReleaseCall_t &&release_call=nullptr) |
Resources (const Resources &other)=delete | |
Resources (Resources &&other)=delete | |
Resources | operator= (const Resources &other)=delete |
Resources | operator= (Resources &&other)=delete |
~Resources () noexcept | |
SWC_CAN_INLINE bool | is_low_mem_state () const noexcept |
SWC_CAN_INLINE size_t | need_ram () const noexcept |
SWC_CAN_INLINE size_t | avail_ram () const noexcept |
SWC_CAN_INLINE bool | need_ram (uint32_t sz) const noexcept |
SWC_CAN_INLINE void | more_mem_future (size_t sz) noexcept |
SWC_CAN_INLINE void | less_mem_future (size_t sz) noexcept |
SWC_CAN_INLINE void | more_mem_releasable (size_t sz) noexcept |
SWC_CAN_INLINE void | less_mem_releasable (size_t sz) noexcept |
SWC_CAN_INLINE void | adj_mem_releasable (ssize_t sz) noexcept |
SWC_CAN_INLINE uint32_t | available_mem_mb () const noexcept |
SWC_CAN_INLINE uint32_t | concurrency () const noexcept |
SWC_CAN_INLINE uint32_t | available_cpu_mhz () const noexcept |
SWC_CAN_INLINE uint32_t | cpu_usage () const noexcept |
void | stop () |
SWC_SHOULD_NOT_INLINE void | print (std::ostream &out) const |
Public Attributes | |
CPU | cpu |
Mem | mem |
Private Member Functions | |
SWC_SHOULD_NOT_INLINE void | checker () noexcept |
SWC_CAN_INLINE void | schedule (uint64_t intval) |
Private Attributes | |
Core::CompletionCounter< uint8_t > | running |
Core::MutexAtomic | m_mutex_timer |
asio::steady_timer | m_timer |
Definition at line 50 of file Resources.h.
|
inline |
Definition at line 56 of file Resources.h.
References checker().
|
delete |
|
delete |
|
inlinenoexcept |
Definition at line 81 of file Resources.h.
|
inlinenoexcept |
Definition at line 124 of file Resources.h.
References SWC::System::Mem::adj_mem_releasable(), and mem.
Referenced by SWC::Ranger::CommitLog::Fragments::_commit(), SWC::Ranger::Block::_split(), SWC::Ranger::CommitLog::Fragments::commit(), SWC::Ranger::Block::load_cells(), and SWC::Ranger::Block::load_final().
|
inlinenoexcept |
Definition at line 94 of file Resources.h.
References SWC::System::Mem::avail_ram(), and mem.
Referenced by SWC::Ranger::CommitLog::Compact::Compact(), and SWC::Ranger::CompactRange::request_more().
|
inlinenoexcept |
Definition at line 139 of file Resources.h.
References cpu, and SWC::System::CPU::mhz.
|
inlinenoexcept |
Definition at line 129 of file Resources.h.
References SWC::System::Mem::available_mem_mb(), and mem.
|
inlineprivatenoexcept |
Definition at line 171 of file Resources.h.
References SWC::System::CPU::check(), SWC::System::Mem::check(), cpu, SWC::Core::CompletionCounter< CountT >::increment(), mem, SWC::Time::now_ms(), running, schedule(), and SWC_LOG_CURRENT_EXCEPTION.
Referenced by Resources(), and schedule().
|
inlinenoexcept |
Definition at line 134 of file Resources.h.
References SWC::System::CPU::concurrency, and cpu.
Referenced by SWC::Ranger::CommitLog::Compact::Compact(), SWC::Manager::MngdColumns::initialize(), and SWC::Ranger::Columns::unload().
|
inlinenoexcept |
Definition at line 144 of file Resources.h.
References cpu, and SWC::System::CPU::usage.
|
inlinenoexcept |
Definition at line 84 of file Resources.h.
References SWC::System::Mem::is_low_mem_state(), and mem.
Referenced by SWC::Ranger::Compaction::available(), and SWC::Comm::Protocol::Rgr::Handler::RangeQuerySelect::operator()().
|
inlinenoexcept |
Definition at line 109 of file Resources.h.
References SWC::System::Mem::less_mem_future(), and mem.
Referenced by SWC::Ranger::CommitLog::Fragments::_commit(), SWC::Ranger::CommitLog::Compact::Group::_loaded(), SWC::Ranger::Compaction::compacted(), SWC::Ranger::CellStore::Block::Read::load_finish(), SWC::Ranger::CommitLog::Fragment::load_finish(), SWC::Ranger::Block::preload(), and SWC::Ranger::Callback::RangeQueryUpdate::~RangeQueryUpdate().
|
inlinenoexcept |
Definition at line 119 of file Resources.h.
References SWC::System::Mem::less_mem_releasable(), and mem.
Referenced by SWC::Ranger::CellStore::Block::Read::load_finish(), SWC::Ranger::CommitLog::Fragment::load_finish(), SWC::Ranger::CommitLog::Fragment::mark_removed(), SWC::Ranger::CellStore::Block::Read::release(), SWC::Ranger::CommitLog::Fragment::release(), SWC::Ranger::Block::release(), SWC::ThriftBroker::AppHandler::updater_close(), SWC::Ranger::CommitLog::Fragment::write(), SWC::Ranger::Block::~Block(), SWC::Ranger::CommitLog::Fragment::~Fragment(), SWC::Ranger::CommitLog::Fragments::~Fragments(), and SWC::Ranger::CellStore::Block::Read::~Read().
|
inlinenoexcept |
Definition at line 104 of file Resources.h.
References mem, and SWC::System::Mem::more_mem_future().
Referenced by SWC::Ranger::CommitLog::Fragments::_commit(), SWC::Ranger::CommitLog::Compact::Group::_loaded(), SWC::Ranger::Compaction::compact(), SWC::Ranger::CellStore::Block::Read::load(), SWC::Ranger::CommitLog::Fragment::load(), SWC::Ranger::Block::preload(), and SWC::Ranger::Callback::RangeQueryUpdate::RangeQueryUpdate().
|
inlinenoexcept |
Definition at line 114 of file Resources.h.
References mem, and SWC::System::Mem::more_mem_releasable().
Referenced by SWC::Ranger::Block::Block(), SWC::Ranger::CommitLog::Fragment::Fragment(), SWC::Ranger::CellStore::Block::Read::load(), SWC::Ranger::CommitLog::Fragment::load(), and SWC::ThriftBroker::AppHandler::updater_create().
|
inlinenoexcept |
Definition at line 89 of file Resources.h.
References mem, and SWC::System::Mem::need_ram().
Referenced by SWC::Ranger::CommitLog::Fragments::_need_roll(), SWC::Ranger::Blocks::_split(), SWC::Ranger::CellStore::Block::Read::load_cells(), SWC::Ranger::CommitLog::Fragment::load_cells(), and SWC::Ranger::Blocks::scan().
|
inlinenoexcept |
Definition at line 99 of file Resources.h.
References mem, and SWC::System::Mem::need_ram().
|
inline |
Definition at line 161 of file Resources.h.
References cpu, mem, SWC::System::CPU::print(), and SWC::System::Mem::print().
|
inlineprivate |
Definition at line 184 of file Resources.h.
References checker(), SWC::Core::CompletionCounter< CountT >::is_last(), m_mutex_timer, m_timer, running, and SWC_CAN_INLINE.
Referenced by checker().
|
inline |
Definition at line 148 of file Resources.h.
References SWC::Core::CompletionCounter< CountT >::count(), m_mutex_timer, m_timer, and running.
Referenced by SWC::Env::Bkr::_shuttingdown().
CPU SWC::System::Resources::cpu |
Definition at line 52 of file Resources.h.
Referenced by available_cpu_mhz(), checker(), concurrency(), cpu_usage(), and print().
|
private |
Definition at line 201 of file Resources.h.
Referenced by schedule(), and stop().
|
private |
Definition at line 202 of file Resources.h.
Referenced by schedule(), and stop().
Mem SWC::System::Resources::mem |
Definition at line 53 of file Resources.h.
Referenced by adj_mem_releasable(), avail_ram(), available_mem_mb(), checker(), is_low_mem_state(), less_mem_future(), less_mem_releasable(), more_mem_future(), more_mem_releasable(), need_ram(), and print().
|
private |
Definition at line 200 of file Resources.h.
Referenced by checker(), schedule(), and stop().