SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
MetricsReporting.cc
Go to the documentation of this file.
1 /*
2  * SWC-DB© Copyright since 2019 Alex Kashirin <kashirin.alex@gmail.com>
3  * License details at <https://github.com/kashirin-alex/swc-db/#license>
4  */
5 
6 
8 
9 
10 namespace SWC { namespace Ranger { namespace Metric {
11 
12 
14  : Common::Query::Update::Metric::Reporting(
15  Env::Clients::get(),
16  a_io,
17  Env::Config::settings()->get<Config::Property::Value_int32_g>(
18  "swc.rgr.metrics.report.interval"),
19  Env::Config::settings()->get_bool("swc.rgr.metrics.report.broker")
20  ? client::Clients::BROKER : client::Clients::DEFAULT
21  ),
22  net(nullptr) {
23 }
24 
25 void Reporting::configure_rgr(const char*, const Comm::EndPoints& endpoints) {
26  char hostname[256];
27  if(gethostname(hostname, sizeof(hostname)) == -1)
28  SWC_THROW(errno, "gethostname");
29 
31  "swcdb", "rgr", hostname, endpoints
32  );
33 
34  level->metrics.emplace_back(
36  endpoints, Env::Config::settings()->get_bool("swc.comm.ssl")));
37 
38  const auto& fs = Env::FsInterface::fs();
39  if(fs->statistics.enabled)
40  level->metrics.emplace_back(new Item_FS(fs));
41  // ++ Ranger Metrics
42 }
43 
44 
45 
46 }}} // namespace SWC::Ranger::Metric
SWC::Common::Query::Update::Metric::Reporting::Reporting
Reporting(const SWC::client::Clients::Ptr &a_clients, const Comm::IoContextPtr &a_io, Config::Property::Value_int32_g::Ptr a_cfg_intval, client::Clients::Flag a_executor=client::Clients::DEFAULT)
Definition: MetricsReporting.h:856
SWC::Env::Config::settings
static SWC::Config::Settings::Ptr & settings()
Definition: Settings.h:128
SWC_THROW
#define SWC_THROW(_code_, _msg_)
Definition: Exception.h:134
SWC::Common::Query::Update::Metric::Item_FS
Definition: MetricsReporting.h:680
SWC::Common::Query::Update::Metric::Reporting::configure
virtual Level * configure(const char *group_name, const char *inst_name, const char *host, const Comm::EndPoints &endpoints)
Definition: MetricsReporting.h:865
SWC::Comm::IoContextPtr
std::shared_ptr< IoContext > IoContextPtr
Definition: IoContext.h:16
SWC::FS::BROKER
@ BROKER
Definition: FileSystem.h:24
SWC
The SWC-DB C++ namespace 'SWC'.
Definition: main.cc:12
SWC::Env::FsInterface::fs
static SWC_CAN_INLINE FS::FileSystem::Ptr & fs() noexcept
Definition: Interface.h:155
SWC::Core::Vector< EndPoint >
MetricsReporting.h
SWC::Common::Query::Update::Metric::Item_Net
Definition: MetricsReporting.h:72