|
SWC-DB
v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
|
Go to the documentation of this file.
7 #ifndef swcdb_common_sys_Resources_h
8 #define swcdb_common_sys_Resources_h
29 virtual void cpu_sys(
size_t) noexcept = 0;
47 namespace SWC {
namespace System {
68 std::move(release_call)
156 std::this_thread::sleep_for(std::chrono::milliseconds(2));
160 SWC_SHOULD_NOT_INLINE
161 void print(std::ostream& out)
const {
164 mem.
print(out <<
" Mem-MB-", 1048576);
170 SWC_SHOULD_NOT_INLINE
186 m_timer.expires_after(std::chrono::milliseconds(intval));
190 TimerTask(
Resources* a_ptr) noexcept : ptr(a_ptr) { }
191 void operator()(
const asio::error_code& ec) {
192 if(ec != asio::error::operation_aborted)
197 m_timer.async_wait(TimerTask(
this));
210 #endif // swcdb_common_sys_Resources_h
SWC_SHOULD_NOT_INLINE void print(std::ostream &out) const
virtual void cpu_sys(size_t) noexcept=0
SWC_CAN_INLINE size_t avail_ram() const noexcept
Core::Atomic< uint32_t > mhz
std::function< size_t(size_t)> ReleaseCall_t
SWC_CAN_INLINE uint32_t available_mem_mb() const noexcept
SWC_CAN_INLINE uint32_t concurrency() const noexcept
SWC_CAN_INLINE size_t avail_ram() const noexcept
Resources operator=(const Resources &other)=delete
virtual void rss_used(size_t) noexcept=0
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)
virtual void rss_used_reg(size_t) noexcept=0
SWC_CAN_INLINE void more_mem_future(size_t sz) noexcept
SWC_CAN_INLINE uint32_t available_mem_mb() const noexcept
std::shared_ptr< IoContext > IoContextPtr
SWC_CAN_INLINE bool need_ram(uint32_t sz) const noexcept
SWC_CAN_INLINE void more_mem_releasable(size_t sz) noexcept
virtual uint64_t get_cpu_ms_interval() const noexcept=0
SWC_CAN_INLINE uint32_t available_cpu_mhz() const noexcept
SWC_CAN_INLINE void more_mem_releasable(size_t sz) noexcept
SWC_CAN_INLINE void less_mem_releasable(size_t sz) noexcept
The SWC-DB C++ namespace 'SWC'.
SWC_CAN_INLINE void less_mem_future(size_t sz) noexcept
asio::steady_timer m_timer
virtual void cpu_threads(size_t) noexcept=0
SWC_SHOULD_NOT_INLINE void checker() noexcept
SWC_CAN_INLINE size_t need_ram() const noexcept
SWC_CAN_INLINE void adj_mem_releasable(ssize_t sz) noexcept
SWC_CAN_INLINE void more_mem_future(size_t sz) noexcept
void print(std::ostream &out) const
SWC_CAN_INLINE size_t need_ram() const noexcept
void print(std::ostream &out, size_t base=1048576) const
SWC_CAN_INLINE void less_mem_future(size_t sz) noexcept
Core::CompletionCounter< uint8_t > running
constexpr SWC_CAN_INLINE CountT count() const noexcept
Core::MutexAtomic m_mutex_timer
constexpr SWC_CAN_INLINE void increment(CountT v=1) noexcept
SWC_CAN_INLINE bool is_low_mem_state() const noexcept
SWC_CAN_INLINE int64_t now_ms() noexcept
SWC_SHOULD_NOT_INLINE uint64_t check(uint64_t ts) noexcept
SWC_CAN_INLINE uint32_t cpu_usage() const noexcept
SWC_CAN_INLINE void adj_mem_releasable(ssize_t sz) noexcept
SWC_CAN_INLINE void less_mem_releasable(size_t sz) noexcept
constexpr SWC_CAN_INLINE bool is_last() noexcept
SWC_CAN_INLINE bool is_low_mem_state() const noexcept
virtual void rss_free(size_t) noexcept=0
virtual void cpu_user(size_t) noexcept=0
Resources(Resources &&other)=delete
SWC_SHOULD_NOT_INLINE uint64_t check(uint64_t ts) noexcept
Resources operator=(Resources &&other)=delete
Core::Atomic< uint32_t > usage
Core::Atomic< uint32_t > concurrency
#define SWC_LOG_CURRENT_EXCEPTION(_s_)
Resources(const Resources &other)=delete
SWC_CAN_INLINE void schedule(uint64_t intval)