SWC-DB  v0.5.9 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
SWC::client::Query::Update::Handlers::Metric::Reporting Class Reference

#include <swcdb/db/client/Query/Update/Handlers/Metrics.h>

+ Inheritance diagram for SWC::client::Query::Update::Handlers::Metric::Reporting:
+ Collaboration diagram for SWC::client::Query::Update::Handlers::Metric::Reporting:

Public Types

typedef std::shared_ptr< ReportingPtr
 
- Public Types inherited from SWC::client::Query::Update::Handlers::BaseSingleColumn
typedef std::shared_ptr< BaseSingleColumnPtr
 
- Public Types inherited from SWC::client::Query::Update::Handlers::Base
typedef std::shared_ptr< BasePtr
 
typedef Core::Vector< Column * > Colms
 

Public Member Functions

 Reporting (const Clients::Ptr &a_clients, const Comm::IoContextPtr &a_io, Config::Property::Value_int32_g::Ptr a_cfg_intval, Clients::Flag a_executor=client::Clients::DEFAULT)
 
virtual ~Reporting () noexcept
 
virtual void start ()
 
virtual void stop ()
 
virtual void wait ()
 
Levelget_level (const char *name)
 
virtual uint64_t apply_time (uint32_t intval, DB::Cell::KeyVec &key)
 
- Public Member Functions inherited from SWC::client::Query::Update::Handlers::BaseSingleColumn
SWC_CAN_INLINE BaseSingleColumn (const Clients::Ptr &a_clients, const cid_t cid, DB::Types::KeySeq seq, uint32_t versions, uint32_t ttl_secs, DB::Types::Column type, Clients::Flag a_executor=Clients::DEFAULT)
 
SWC_CAN_INLINE BaseSingleColumn (const Clients::Ptr &a_clients, const cid_t cid, DB::Types::KeySeq seq, uint32_t versions, uint32_t ttl_secs, DB::Types::Column type, const StaticBuffer &buffer)
 
 BaseSingleColumn (const BaseSingleColumn &)=delete
 
 BaseSingleColumn (const BaseSingleColumn &&)=delete
 
BaseSingleColumnoperator= (const BaseSingleColumn &)=delete
 
virtual ~BaseSingleColumn () noexcept
 
virtual bool requires_commit () noexcept override
 
virtual bool empty () noexcept override
 
virtual size_t size_bytes () noexcept override
 
virtual void next (Base::Colms &cols) noexcept override
 
virtual Base::Columnnext (cid_t cid) noexcept override
 
virtual void error (cid_t cid, int err) noexcept override
 
SWC_CAN_INLINE size_t size () noexcept
 
- Public Member Functions inherited from SWC::client::Query::Update::Handlers::Base
SWC_CAN_INLINE Base (const Clients::Ptr &a_clients, Clients::Flag a_executor=Clients::Flag::DEFAULT) noexcept
 
virtual int error () noexcept
 
virtual void error (int err) noexcept
 
SWC_CAN_INLINE void add_resend_count (size_t count) noexcept
 
SWC_CAN_INLINE size_t get_resend_count (bool reset=true) noexcept
 
void commit ()
 
SWC_CAN_INLINE void commit (const cid_t cid)
 
void commit (Column *colp)
 

Public Attributes

const Comm::IoContextPtr io
 
Config::Property::Value_int32_g::Ptr cfg_intval
 
Core::Vector< Metric::Base::Ptrmetrics
 
Core::AtomicBool running
 
- Public Attributes inherited from SWC::client::Query::Update::Handlers::BaseSingleColumn
ColumnMutable column
 
- Public Attributes inherited from SWC::client::Query::Update::Handlers::Base
Clients::Ptr clients
 
Profiling profile
 
Core::Atomic< int > state_error
 
Core::CompletionCounter< uint64_t > completion
 
Core::Atomic< uint32_t > timeout
 
Core::Atomic< uint32_t > timeout_ratio
 
Core::Atomic< uint32_t > buff_sz
 
Core::Atomic< uint8_t > buff_ahead
 
const Clients::Flag executor
 

Protected Member Functions

virtual bool valid () noexcept override
 
virtual void response (int err=Error::OK) override
 
- Protected Member Functions inherited from SWC::client::Query::Update::Handlers::Base
virtual void _execute (Column *colp)
 
virtual ~Base () noexcept
 

Protected Attributes

Core::MutexSptd m_mutex
 

Private Member Functions

void report ()
 
void schedule ()
 

Private Attributes

asio::high_resolution_timer m_timer
 

Detailed Description

Definition at line 233 of file Metrics.h.

Member Typedef Documentation

◆ Ptr

Definition at line 236 of file Metrics.h.

Constructor & Destructor Documentation

◆ Reporting()

SWC::client::Query::Update::Handlers::Metric::Reporting::Reporting ( const Clients::Ptr a_clients,
const Comm::IoContextPtr a_io,
Config::Property::Value_int32_g::Ptr  a_cfg_intval,
Clients::Flag  a_executor = client::Clients::DEFAULT 
)

Definition at line 197 of file Metrics.cc.

◆ ~Reporting()

virtual SWC::client::Query::Update::Handlers::Metric::Reporting::~Reporting ( )
inlinevirtualnoexcept

Member Function Documentation

◆ apply_time()

uint64_t SWC::client::Query::Update::Handlers::Metric::Reporting::apply_time ( uint32_t  intval,
DB::Cell::KeyVec key 
)
virtual

Definition at line 240 of file Metrics.cc.

References SWC::DB::Cell::KeyVec::add(), and SWC::Core::to_string().

Referenced by report().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_level()

Level * SWC::client::Query::Update::Handlers::Metric::Reporting::get_level ( const char *  name)

Definition at line 230 of file Metrics.cc.

References SWC::Core::Vector< T, SizeT, GROW_SZ >::emplace_back(), SWC::client::Query::Update::Handlers::Metric::Level::get_level(), and metrics.

+ Here is the call graph for this function:

◆ report()

void SWC::client::Query::Update::Handlers::Metric::Reporting::report ( )
private

◆ response()

◆ schedule()

void SWC::client::Query::Update::Handlers::Metric::Reporting::schedule ( )
private

Definition at line 305 of file Metrics.cc.

References cfg_intval, SWC::Config::Property::Value_int32_g::get(), m_mutex, m_timer, report(), running, and SWC_CAN_INLINE.

Referenced by report(), response(), and start().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ start()

virtual void SWC::client::Query::Update::Handlers::Metric::Reporting::start ( )
inlinevirtual

Definition at line 250 of file Metrics.h.

References SWC::Core::AtomicBase< T, OrderT >::compare_exchange_weak(), running, and schedule().

+ Here is the call graph for this function:

◆ stop()

void SWC::client::Query::Update::Handlers::Metric::Reporting::stop ( )
virtual

Definition at line 213 of file Metrics.cc.

References SWC::Core::AtomicBase< T, OrderT >::compare_exchange_weak(), m_mutex, m_timer, and running.

+ Here is the call graph for this function:

◆ valid()

virtual bool SWC::client::Query::Update::Handlers::Metric::Reporting::valid ( )
inlineoverrideprotectedvirtualnoexcept

Implements SWC::client::Query::Update::Handlers::Base.

Definition at line 268 of file Metrics.h.

References running.

◆ wait()

void SWC::client::Query::Update::Handlers::Metric::Reporting::wait ( )
virtual

Definition at line 221 of file Metrics.cc.

References SWC::client::Query::Update::Handlers::Base::completion, SWC::Core::CompletionCounter< CountT >::count(), SWC::LOG_WARN, SWC_FMT_LU, and SWC_LOGF.

+ Here is the call graph for this function:

Member Data Documentation

◆ cfg_intval

Config::Property::Value_int32_g::Ptr SWC::client::Query::Update::Handlers::Metric::Reporting::cfg_intval

◆ io

const Comm::IoContextPtr SWC::client::Query::Update::Handlers::Metric::Reporting::io

Definition at line 238 of file Metrics.h.

◆ m_mutex

Core::MutexSptd SWC::client::Query::Update::Handlers::Metric::Reporting::m_mutex
protected

Definition at line 266 of file Metrics.h.

Referenced by schedule(), and stop().

◆ m_timer

asio::high_resolution_timer SWC::client::Query::Update::Handlers::Metric::Reporting::m_timer
private

Definition at line 281 of file Metrics.h.

Referenced by schedule(), and stop().

◆ metrics

Core::Vector<Metric::Base::Ptr> SWC::client::Query::Update::Handlers::Metric::Reporting::metrics

Definition at line 240 of file Metrics.h.

Referenced by get_level(), and report().

◆ running

Core::AtomicBool SWC::client::Query::Update::Handlers::Metric::Reporting::running

Definition at line 241 of file Metrics.h.

Referenced by report(), response(), schedule(), start(), stop(), and valid().


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