SWC-DB  v0.5.11 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
MetricsReporting.h
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 
7 #ifndef swcdb_common_queries_update_MetricsReporting_h
8 #define swcdb_common_queries_update_MetricsReporting_h
9 
10 
12 #include "swcdb/fs/Interface.h"
14 
15 
16 namespace SWC { namespace Common {
17 
19 namespace Query {
20 
22 namespace Update {
23 
25 namespace Metric {
26 
27 using namespace client::Query::Update::Handlers::Metric;
28 
29 
30 
31 namespace { // local namespace
32 
34 static size_t encoded_length(
36  bool with_count) noexcept {
37  size_t sz = 0;
38  if(value.count && value.total) {
39  uint64_t avg = value.avg();
40  if(avg != value.min)
41  sz += 2 + Serialization::encoded_length_vi64(value.min);
42  if(avg != value.max)
43  sz += 2 + Serialization::encoded_length_vi64(value.max);
44  if(with_count)
47  }
48  return sz;
49 }
50 
52 static void add_value(
54  uint8_t field_start, bool with_count,
55  DB::Cell::Serial::Value::FieldsWriter& wfields) noexcept {
56  if(value.count && value.total) {
57  uint64_t avg = value.avg();
58  if(avg != value.min)
59  wfields.add(field_start, int64_t(value.min));
60  if(avg != value.max)
61  wfields.add(field_start + 1, int64_t(value.max));
62  if(with_count)
63  wfields.add(field_start + 2, int64_t(value.count));
64  wfields.add(field_start + 2 + with_count, int64_t(avg));
65  }
66 }
67 
68 }
69 
70 
71 template<typename CommandsT>
72 class Item_Net : public Base {
73  /* Cell-Serialization:
74  key: [levels, "net", "{address}", is_secure()?"SECURE":"PLAIN"]
75  value: {FIELD_ID}:I:{value}, ...
76  */
77  static constexpr const uint8_t FIELD_CONN_OPEN = 0;
78  static constexpr const uint8_t FIELD_CONN_ACC = 1;
79  static constexpr const uint8_t FIELD_CONN_EST = 2;
80 
81  static constexpr const uint8_t FIELD_BYTES_SENT_MIN = 3;
82  static constexpr const uint8_t FIELD_BYTES_SENT_MAX = 4;
83  static constexpr const uint8_t FIELD_BYTES_SENT_TRX = 5;
84  static constexpr const uint8_t FIELD_BYTES_SENT_AVG = 6;
85 
86  static constexpr const uint8_t FIELD_BYTES_RECV_MIN = 7;
87  static constexpr const uint8_t FIELD_BYTES_RECV_MAX = 8;
88  static constexpr const uint8_t FIELD_BYTES_RECV_TRX = 9;
89  static constexpr const uint8_t FIELD_BYTES_RECV_AVG = 10;
90 
91  static constexpr const uint8_t FIELD_EV_COMMAND_START = 100; // {100 + CMD}
92 
93  public:
94  typedef std::unique_ptr<Item_Net> Ptr;
95 
96  struct Addr {
97  const asio::ip::address addr;
104 
106  Addr(const Comm::EndPoint& endpoint) noexcept
107  : addr(endpoint.address()),
108  conn_open(0), conn_accept(0), conn_est(0) {
109  }
110  };
111 
112  Item_Net(const Comm::EndPoints& endpoints, bool using_secure) {
113  for(uint8_t secure = 0; secure <= using_secure; ++secure) {
114  m_addresses[secure].reserve(endpoints.size());
115  for(auto& endpoint : endpoints)
116  m_addresses[secure].emplace_back(new Addr(endpoint));
117  }
118  }
119 
120  virtual ~Item_Net() noexcept { }
121 
123  Addr* get(const asio::ip::address& for_addr, bool secure) const noexcept {
124  for(auto& addr : m_addresses[secure]) {
125  if(addr->addr.is_unspecified() || addr->addr == for_addr)
126  return addr.get();
127  }
128  return nullptr;
129  }
130 
132  void accepted(const Comm::EndPoint& endpoint, bool secure) noexcept {
133  if(Addr* addr = get(endpoint.address(), secure))
134  addr->conn_accept.fetch_add(1);
135  }
136 
138  void connected() noexcept {
139  Addr* addr = m_addresses[0].front().get();
140  addr->conn_open.fetch_add(1);
141  addr->conn_est.fetch_add(1);
142  }
143 
145  void disconnected() noexcept {
146  Addr* addr = m_addresses[0].front().get();
147  addr->conn_open.fetch_sub(1);
148  }
149 
151  void connected(const Comm::ConnHandlerPtr& conn) noexcept {
152  if(Addr* addr = get(conn->endpoint_local.address(), conn->is_secure())) {
153  addr->conn_open.fetch_add(1);
154  addr->conn_est.fetch_add(1);
155  }
156  }
157 
159  void disconnected(const Comm::ConnHandlerPtr& conn) noexcept {
160  if(Addr* addr = get(conn->endpoint_local.address(), conn->is_secure()))
161  addr->conn_open.fetch_sub(1);
162  }
163 
165  void command(const Comm::ConnHandlerPtr& conn, uint8_t cmd) noexcept {
166  if(Addr* addr = get(conn->endpoint_local.address(), conn->is_secure()))
167  addr->commands[cmd].fetch_add(1);
168  }
169 
171  void error(const Comm::ConnHandlerPtr& conn) noexcept {
172  if(Addr* addr = get(conn->endpoint_local.address(), conn->is_secure()))
173  addr->commands[CommandsT::MAX - 1].fetch_add(1);
174  }
175 
177  void sent(const Comm::ConnHandlerPtr& conn, size_t bytes) noexcept {
178  if(Addr* addr = get(conn->endpoint_local.address(), conn->is_secure()))
179  addr->bytes_sent.add(bytes);
180  }
181 
183  void received(const Comm::ConnHandlerPtr& conn, size_t bytes) noexcept {
184  if(Addr* addr = get(conn->endpoint_local.address(), conn->is_secure()))
185  addr->bytes_recv.add(bytes);
186  }
187 
189  const DB::Cell::KeyVec& parent_key) override {
190  bool secure = false;
191  _do_layer:
192  for(auto& addr : m_addresses[secure]) {
193 
194  DB::Cells::Cell cell;
195  cell.flag = DB::Cells::INSERT;
196  cell.set_time_order_desc(true);
197  cell.key.add(parent_key);
198  cell.key.add("net");
199  cell.key.add(addr->addr.to_string());
200  cell.key.add(secure ? "SECURE" : "PLAIN");
201 
202 
206  Core::Vector<int64_t> aggregations;
207  Core::Vector<int64_t> relations;
208  ids.reserve(11 + CommandsT::MAX);
209  names.reserve(ids.size());
210  labels.reserve(ids.size());
211  aggregations.reserve(ids.size());
212 
213  ids.push_back(FIELD_BYTES_SENT_MIN);
214  names.push_back("sent_min");
215  labels.push_back("Send Bytes Minimum");
216  aggregations.push_back(Aggregation::MIN);
217  relations.push_back(1);
218 
219  ids.push_back(FIELD_BYTES_SENT_MAX);
220  names.push_back("sent_max");
221  labels.push_back("Send Bytes Maximum");
222  aggregations.push_back(Aggregation::MAX);
223  relations.push_back(1);
224 
225  ids.push_back(FIELD_BYTES_SENT_TRX);
226  names.push_back("send_trx");
227  labels.push_back("Send Transactions");
228  aggregations.push_back(Aggregation::SUM);
229  relations.push_back(1);
230 
231  ids.push_back(FIELD_BYTES_SENT_AVG);
232  names.push_back("sent_avg");
233  labels.push_back("Send Bytes Average");
234  aggregations.push_back(Aggregation::AVG_PROP);
235  relations.push_back(1);
236 
237 
238  ids.push_back(FIELD_BYTES_RECV_MIN);
239  names.push_back("recv_min");
240  labels.push_back("Receive Bytes Minimum");
241  aggregations.push_back(Aggregation::MIN);
242  relations.push_back(2);
243 
244  ids.push_back(FIELD_BYTES_RECV_MAX);
245  names.push_back("recv_max");
246  labels.push_back("Receive Bytes Maximum");
247  aggregations.push_back(Aggregation::MAX);
248  relations.push_back(2);
249 
250  ids.push_back(FIELD_BYTES_RECV_TRX);
251  names.push_back("recv_trx");
252  labels.push_back("Receive Transactions");
253  aggregations.push_back(Aggregation::SUM);
254  relations.push_back(2);
255 
256  ids.push_back(FIELD_BYTES_RECV_AVG);
257  names.push_back("recv_avg");
258  labels.push_back("Receive Bytes Average");
259  aggregations.push_back(Aggregation::AVG_PROP);
260  relations.push_back(2);
261 
262  ids.push_back(FIELD_CONN_OPEN);
263  names.push_back("open");
264  labels.push_back("Open Connections");
265  aggregations.push_back(Aggregation::MAX);
266 
267  ids.push_back(FIELD_CONN_ACC);
268  names.push_back("accept");
269  labels.push_back("Accepted Connections");
270 
271  ids.push_back(FIELD_CONN_EST);
272  names.push_back("established");
273  labels.push_back("Connections Established");
274 
275  for(uint8_t i=0; i < CommandsT::MAX; ++i) {
276  std::string cmd(CommandsT::to_string(i));
277  ids.push_back(i + FIELD_EV_COMMAND_START);
278  names.push_back(cmd);
279  labels.push_back(cmd + " Requests");
280  }
281  size_t sz = 15 + 2 * ids.size() + relations.size();
282  for(size_t i=0; i < names.size(); ++i) {
283  sz += names[i].size();
284  sz += labels[i].size();
285  }
286  {
288  wfields.ensure(sz);
289  wfields.add(ids);
290  wfields.add(names);
291  wfields.add(labels);
292  wfields.add(aggregations);
293  wfields.add(relations);
294  cell.set_value(DB::Types::Encoder::ZSTD, wfields.base, wfields.fill());
295  }
296  colp->add(cell);
297  }
298 
299  if(!secure) {
300  secure = true;
301  if(!m_addresses[secure].empty())
302  goto _do_layer;
303  }
304  }
305 
306  virtual void report(uint64_t for_ns,
308  const DB::Cell::KeyVec& parent_key) override {
309  int64_t conn_open = 0;
310  int64_t conn_accept = 0;
311  int64_t conn_est = 0;
314 
315  bool secure = false;
316  _do_layer:
317  for(auto& addr : m_addresses[secure]) {
318  DB::Cell::KeyVec key;
319  key.reserve(parent_key.size() + 3);
320  key.copy(parent_key);
321  key.add("net");
322  key.add(addr->addr.to_string());
323  key.add(secure ? "SECURE" : "PLAIN");
324 
325  DB::Cells::Cell cell;
326  cell.flag = DB::Cells::INSERT;
327  cell.set_time_order_desc(true);
328  cell.set_timestamp(for_ns);
329  cell.key.add(key);
330 
331  conn_open = addr->conn_open.load();
332  size_t sz = 2 + Serialization::encoded_length_vi64(conn_open);
333  if((conn_accept = addr->conn_accept.exchange(0)))
334  sz += 2 + Serialization::encoded_length_vi64(conn_accept);
335  if((conn_est = addr->conn_est.exchange(0)))
336  sz += 2 + Serialization::encoded_length_vi64(conn_est);
337 
338  addr->bytes_sent.gather(bytes_sent);
339  sz += encoded_length(bytes_sent, true);
340  addr->bytes_recv.gather(bytes_recv);
341  sz += encoded_length(bytes_recv, true);
342 
343  int64_t counts[CommandsT::MAX];
344  for(uint8_t i=0; i < CommandsT::MAX; ++i) {
345  if((counts[i] = addr->commands[i].exchange(0)))
346  sz += 2 + Serialization::encoded_length_vi64(counts[i]);
347  }
348 
350  wfields.ensure(sz);
351 
352  add_value(bytes_sent, FIELD_BYTES_SENT_MIN, true, wfields);
353  add_value(bytes_recv, FIELD_BYTES_RECV_MIN, true, wfields);
354 
355  wfields.add(FIELD_CONN_OPEN, conn_open);
356  if(conn_accept)
357  wfields.add(FIELD_CONN_ACC, conn_accept);
358  if(conn_est)
359  wfields.add(FIELD_CONN_EST, conn_est);
360  for(uint8_t i=0; i < CommandsT::MAX; ++i) {
361  if(counts[i])
362  wfields.add(i + FIELD_EV_COMMAND_START, counts[i]);
363  }
364  cell.set_value(wfields.base, wfields.fill(), false);
365  colp->add(cell);
366  }
367 
368  if(!secure) {
369  secure = true;
370  if(!m_addresses[secure].empty())
371  goto _do_layer;
372  }
373  }
374 
375  virtual void reset() override {
376  bool secure = false;
377  _do_layer:
378  for(auto& addr : m_addresses[secure]) {
379  addr->conn_open.store(0);
380  addr->conn_accept.store(0);
381  addr->conn_est.store(0);
382  addr->bytes_sent.reset();
383  addr->bytes_recv.reset();
384  for(auto& c : addr->commands) {
385  c.store(0);
386  }
387  }
388  if(!secure) {
389  secure = true;
390  if(!m_addresses[secure].empty())
391  goto _do_layer;
392  }
393  }
394 
395 
396  protected:
398 };
399 
400 
401 
402 class Item_Mem : public Base {
403  /* Cell-Serialization:
404  key: [levels, "mem"]
405  value: {FIELD_ID}:I:{value}, ...
406  */
407  static constexpr const uint8_t FIELD_RSS_FREE_MIN = 0;
408  static constexpr const uint8_t FIELD_RSS_FREE_MAX = 1;
409  static constexpr const uint8_t FIELD_RSS_FREE_AVG = 2;
410 
411  static constexpr const uint8_t FIELD_RSS_USED_MIN = 3;
412  static constexpr const uint8_t FIELD_RSS_USED_MAX = 4;
413  static constexpr const uint8_t FIELD_RSS_USED_AVG = 5;
414 
415  static constexpr const uint8_t FIELD_RSS_USED_REG_MIN = 6;
416  static constexpr const uint8_t FIELD_RSS_USED_REG_MAX = 7;
417  static constexpr const uint8_t FIELD_RSS_USED_REG_AVG = 8;
418 
419  public:
420  typedef std::unique_ptr<Item_Mem> Ptr;
421 
425 
426  Item_Mem() noexcept { }
427 
428  virtual ~Item_Mem() noexcept { }
429 
431  const DB::Cell::KeyVec& parent_key) override {
432  DB::Cell::KeyVec key;
433  key.reserve(parent_key.size() + 1);
434  key.copy(parent_key);
435  key.add("mem");
436 
437  DB::Cells::Cell cell;
438  cell.flag = DB::Cells::INSERT;
439  cell.set_time_order_desc(true);
440  cell.key.add(key);
441 
443  wfields.add(Core::Vector<int64_t>({
444  FIELD_RSS_FREE_MIN,
445  FIELD_RSS_FREE_MAX,
446  FIELD_RSS_FREE_AVG,
447  FIELD_RSS_USED_MIN,
448  FIELD_RSS_USED_MAX,
449  FIELD_RSS_USED_AVG,
450  FIELD_RSS_USED_REG_MIN,
451  FIELD_RSS_USED_REG_MAX,
452  FIELD_RSS_USED_REG_AVG,
453  }));
455  "rss_free_min",
456  "rss_free_max",
457  "rss_free_avg",
458  "rss_used_min",
459  "rss_used_max",
460  "rss_used_avg",
461  "rss_reg_min",
462  "rss_reg_max",
463  "rss_reg_avg"
464  }));
466  "RSS Free Minimal",
467  "RSS Free Maximal",
468  "RSS Free Average",
469  "RSS Used Minimal",
470  "RSS Used Maximal",
471  "RSS Used Average",
472  "RSS Registred Minimal",
473  "RSS Registred Maximal",
474  "RSS Registred Average"
475  }));
476  wfields.add(Core::Vector<int64_t>({
486  }));
487  cell.set_value(DB::Types::Encoder::ZSTD ,wfields.base, wfields.fill());
488  colp->add(cell);
489  }
490 
491  virtual void report(uint64_t for_ns, client::Query::Update::Handlers::Base::Column* colp,
492  const DB::Cell::KeyVec& parent_key) override {
494  rss_free.gather(_rss_free);
495 
497  rss_used.gather(_rss_used);
498 
500  rss_used_reg.gather(_rss_used_reg);
501 
502  size_t sz = encoded_length(_rss_free, false);
503  sz += encoded_length(_rss_used, false);
504  sz += encoded_length(_rss_used_reg, false);
505  if(!sz)
506  return;
507 
508  DB::Cell::KeyVec key;
509  key.reserve(parent_key.size() + 1);
510  key.copy(parent_key);
511  key.add("mem");
512 
513  DB::Cells::Cell cell;
514  cell.flag = DB::Cells::INSERT;
515  cell.set_time_order_desc(true);
516  cell.set_timestamp(for_ns);
517  cell.key.add(key);
518 
519 
521  wfields.ensure(sz);
522  add_value(_rss_free, FIELD_RSS_FREE_MIN, false, wfields);
523  add_value(_rss_used, FIELD_RSS_USED_MIN, false, wfields);
524  add_value(_rss_used_reg, FIELD_RSS_USED_REG_MIN, false, wfields);
525 
526  cell.set_value(wfields.base, wfields.fill(), false);
527  colp->add(cell);
528  }
529 
530  virtual void reset() override {
531  rss_free.reset();
532  rss_used.reset();
533  rss_used_reg.reset();
534  }
535 
536 };
537 
538 
539 
540 class Item_CPU : public Base {
541  /* Cell-Serialization:
542  key: [levels, "cpu"]
543  value: {FIELD_ID}:I:{value}, ...
544  */
545  static constexpr const uint8_t FIELD_CPU_U_PERC_MIN = 0;
546  static constexpr const uint8_t FIELD_CPU_U_PERC_MAX = 1;
547  static constexpr const uint8_t FIELD_CPU_U_PERC_AVG = 2;
548 
549  static constexpr const uint8_t FIELD_CPU_S_PERC_MIN = 3;
550  static constexpr const uint8_t FIELD_CPU_S_PERC_MAX = 4;
551  static constexpr const uint8_t FIELD_CPU_S_PERC_AVG = 5;
552 
553  static constexpr const uint8_t FIELD_NTHREADS_MIN = 6;
554  static constexpr const uint8_t FIELD_NTHREADS_MAX = 7;
555  static constexpr const uint8_t FIELD_NTHREADS_AVG = 8;
556 
557  public:
558  typedef std::unique_ptr<Item_CPU> Ptr;
559 
563 
564  Item_CPU() noexcept { }
565 
566  virtual ~Item_CPU() noexcept { }
567 
569  const DB::Cell::KeyVec& parent_key) override {
570  DB::Cell::KeyVec key;
571  key.reserve(parent_key.size() + 1);
572  key.copy(parent_key);
573  key.add("cpu");
574 
575  DB::Cells::Cell cell;
576  cell.flag = DB::Cells::INSERT;
577  cell.set_time_order_desc(true);
578  cell.key.add(key);
579 
581  wfields.add(Core::Vector<int64_t>({
582  FIELD_CPU_U_PERC_MIN,
583  FIELD_CPU_U_PERC_MAX,
584  FIELD_CPU_U_PERC_AVG,
585  FIELD_CPU_S_PERC_MIN,
586  FIELD_CPU_S_PERC_MAX,
587  FIELD_CPU_S_PERC_AVG,
588  FIELD_NTHREADS_MIN,
589  FIELD_NTHREADS_MAX,
590  FIELD_NTHREADS_AVG,
591  }));
593  "u_min",
594  "u_max",
595  "u_avg",
596  "s_min",
597  "s_max",
598  "s_avg",
599  "t_min",
600  "t_max",
601  "t_avg"
602  }));
604  "User %m Minimal",
605  "User %m Maximal",
606  "User %m Average",
607  "Sys %m Minimal",
608  "Sys %m Maximal",
609  "Sys %m Average",
610  "Threads Minimal",
611  "Threads Maximal",
612  "Threads Average"
613  }));
614  wfields.add(Core::Vector<int64_t>({
624  }));
625  cell.set_value(DB::Types::Encoder::ZSTD, wfields.base, wfields.fill());
626  colp->add(cell);
627  }
628 
629  virtual void report(uint64_t for_ns,
631  const DB::Cell::KeyVec& parent_key) override {
632 
634  percent_user.gather(_percent_user);
635 
637  percent_sys.gather(_percent_sys);
638 
640  nthreads.gather(_nthreads);
641 
642  size_t sz = encoded_length(_percent_user, false);
643  sz += encoded_length(_percent_sys, false);
644  sz += encoded_length(_nthreads, false);
645  if(!sz)
646  return;
647 
648  DB::Cell::KeyVec key;
649  key.reserve(parent_key.size() + 1);
650  key.copy(parent_key);
651  key.add("cpu");
652 
653  DB::Cells::Cell cell;
654  cell.flag = DB::Cells::INSERT;
655  cell.set_time_order_desc(true);
656  cell.set_timestamp(for_ns);
657  cell.key.add(key);
658 
660  wfields.ensure(sz);
661  add_value(_percent_user, FIELD_CPU_U_PERC_MIN, false, wfields);
662  add_value(_percent_sys, FIELD_CPU_S_PERC_MIN, false, wfields);
663  add_value(_nthreads, FIELD_NTHREADS_MIN, false, wfields);
664 
665  cell.set_value(wfields.base, wfields.fill(), false);
666  colp->add(cell);
667  }
668 
669  virtual void reset() override {
670  percent_user.reset();
671  percent_sys.reset();
672  nthreads.reset();
673  }
674 
675 };
676 
677 
678 
679 class Item_FS : public Base {
680  /* Cell-Serialization:
681  key: [levels, "fs", {type}]
682  value: (FIELD_{type} + FS_{cmd}):I:{value}, ...
683  */
684  static constexpr const uint8_t FIELD_FDS = 0;
685  static constexpr const uint8_t FIELD_MIN = 1;
686  static constexpr const uint8_t FIELD_MAX = 2;
687  static constexpr const uint8_t FIELD_COUNT = 3;
688  static constexpr const uint8_t FIELD_AVG = 4;
689  static constexpr const uint8_t FIELD_ERROR = 5;
690 
691  public:
692 
693  typedef std::unique_ptr<Item_FS> Ptr;
695 
696  Item_FS(const FS::FileSystem::Ptr& a_fs) noexcept : fs(a_fs) { }
697 
698  virtual ~Item_FS() noexcept { }
699 
701  const DB::Cell::KeyVec& parent_key) override {
702  DB::Cell::KeyVec key;
703  key.reserve(parent_key.size() + 2);
704  key.copy(parent_key);
705  key.add("fs");
706  key.add(FS::to_string(fs->get_type()));
707 
708  DB::Cells::Cell cell;
709  cell.flag = DB::Cells::INSERT;
710  cell.set_time_order_desc(true);
711  cell.key.add(key);
712 
713  Core::Vector<int64_t> relations;
717  Core::Vector<int64_t> aggregations;
719  names.reserve(ids.size());
720  labels.reserve(ids.size());
721  aggregations.reserve(2 + FS::Statistics::Command::MAX * 4);
722  relations.reserve(1 + FS::Statistics::Command::MAX * 2);
723 
724  int64_t relation=0;
725  for(uint8_t i, c=0; c < FS::Statistics::Command::MAX; ++c) {
727  i = c * 5;
728  ids.push_back(FIELD_COUNT + i);
729  ids.push_back(FIELD_AVG + i);
730  names.push_back(cmd + "_count");
731  names.push_back(cmd + "_avg");
732  labels.push_back(cmd + " Requests Count");
733  labels.push_back(cmd + " Latency ns Average");
734  aggregations.push_back(Aggregation::SUM);
735  aggregations.push_back(Aggregation::AVG_PROP);
736  relations.push_back(++relation);
737  relations.push_back(relation);
738  }
739  ids.push_back(FIELD_FDS);
740  names.push_back("open");
741  labels.push_back("Open File Descriptors");
742  aggregations.push_back(Aggregation::MAX);
743 
744  for(uint8_t i, c=0; c < FS::Statistics::Command::MAX; ++c) {
746  i = c * 5;
747  ids.push_back(FIELD_MIN + i);
748  ids.push_back(FIELD_MAX + i);
749  names.push_back(cmd + "_min");
750  names.push_back(cmd + "_max");
751  labels.push_back(cmd + " Latency ns Minimum");
752  labels.push_back(cmd + " Latency ns Maximum");
753  aggregations.push_back(Aggregation::MIN);
754  aggregations.push_back(Aggregation::MAX);
755  }
756  for(uint8_t i, c=0; c < FS::Statistics::Command::MAX; ++c) {
758  i = c * 5;
759  ids.push_back(FIELD_ERROR + i);
760  names.push_back(cmd + "_error");
761  labels.push_back(cmd + " Errors Count");
762  }
763 
764  size_t sz = 15 + 3 * ids.size();
765  for(uint8_t i=0; i < names.size(); ++i) {
766  sz += names[i].size();
767  sz += labels[i].size();
768  }
770  wfields.ensure(sz);
771  wfields.add(ids);
772  wfields.add(names);
773  wfields.add(labels);
774  wfields.add(aggregations);
775  wfields.add(relations);
776  cell.set_value(DB::Types::Encoder::ZSTD, wfields.base, wfields.fill());
777  colp->add(cell);
778  }
779 
780  virtual void report(uint64_t for_ns,
782  const DB::Cell::KeyVec& parent_key) override {
783  std::unique_ptr<FS::Statistics> statsp(new FS::Statistics(true));
784  FS::Statistics& stats(*statsp.get());
785  fs->statistics.gather(stats);
786  uint64_t open_fds = fs->statistics.fds_count.load();
787 
788  size_t sz = open_fds
789  ? (2 + Serialization::encoded_length_vi64(open_fds))
790  : 0;
791  for(uint8_t cmd=0; cmd < FS::Statistics::Command::MAX; ++cmd) {
792  auto& m = stats.metrics[cmd];
793  if(m.m_count) {
794  uint64_t avg = m.m_total/m.m_count;
795  if(avg != m.m_min)
796  sz += 2 + Serialization::encoded_length_vi64(m.m_min);
797  if(avg != m.m_max)
798  sz += 2 + Serialization::encoded_length_vi64(m.m_max);
799  sz += 2 + Serialization::encoded_length_vi64(avg);
800  if(m.m_error)
801  sz += 2 + Serialization::encoded_length_vi64(m.m_error);
802  sz += 2 + Serialization::encoded_length_vi64(m.m_count);
803  }
804  }
805  if(!sz)
806  return;
807 
808  DB::Cells::Cell cell;
809  cell.flag = DB::Cells::INSERT;
810  cell.set_time_order_desc(true);
811  cell.set_timestamp(for_ns);
812  cell.key.add(parent_key);
813  cell.key.add("fs");
814  cell.key.add(FS::to_string(fs->get_type()));
815 
817  wfields.ensure(sz);
818 
819  if(open_fds)
820  wfields.add(FIELD_FDS, int64_t(open_fds));
821 
822  for(uint8_t i, cmd=0; cmd < FS::Statistics::Command::MAX; ++cmd) {
823  auto& m = stats.metrics[cmd];
824  if(m.m_count) {
825  i = cmd * 5;
826  uint64_t avg = m.m_total/m.m_count;
827  if(avg != m.m_min)
828  wfields.add(FIELD_MIN + i, int64_t(m.m_min));
829  if(avg != m.m_max)
830  wfields.add(FIELD_MAX + i, int64_t(m.m_max));
831  wfields.add(FIELD_COUNT + i, int64_t(m.m_count));
832  wfields.add(FIELD_AVG + i, int64_t(avg));
833  if(m.m_error)
834  wfields.add(FIELD_ERROR + i, int64_t(m.m_error));
835  }
836  }
837 
838  cell.set_value(wfields.base, wfields.fill(), false);
839  colp->add(cell);
840  }
841 
842  virtual void reset() override {
843  fs->statistics.reset();
844  }
845 
846 };
847 
848 
849 
851  public:
852 
853  typedef std::shared_ptr<Reporting> Ptr;
854 
856  const Comm::IoContextPtr& a_io,
859  : client::Query::Update::Handlers::Metric::Reporting(
860  a_clients, a_io, a_cfg_intval, a_executor),
861  system(this), cpu(nullptr), mem(nullptr) {
862  }
863 
864  virtual Level* configure(const char* group_name, const char* inst_name,
865  const char* host, const Comm::EndPoints& endpoints) {
866  auto level = host ? get_level(host) : nullptr;
867  if(group_name)
868  level = level ? level->get_level(group_name) : get_level(group_name);
869  if(inst_name)
870  level = level ? level->get_level(inst_name) : get_level(inst_name);
871  if(!endpoints.empty()) {
872  std::string port(std::to_string(endpoints.front().port()));
873  level = level ? level->get_level(port.c_str()) : get_level(port.c_str());
874  }
875  SWC_ASSERT(level);
876 
877  level->metrics.emplace_back(cpu = system.cpu);
878  level->metrics.emplace_back(mem = system.mem);
879  return level;
880  }
881 
882  virtual ~Reporting() noexcept { }
883 
884 
885  struct System final : SWC::System::Notifier {
889 
890  System(Reporting* a_reporting)
891  : reporting(a_reporting),
892  cpu(new Item_CPU()),
893  mem(new Item_Mem()) {
894  }
895 
896  void rss_used_reg(size_t bytes) noexcept override {
897  mem->rss_used_reg.add(bytes / 1048576);
898  }
899 
900  void rss_free(size_t bytes) noexcept override {
901  mem->rss_free.add(bytes / 1048576);
902  }
903 
904  void rss_used(size_t bytes) noexcept override {
905  mem->rss_used.add(bytes / 1048576);
906  }
907 
908  void cpu_user(size_t perc_milli) noexcept override {
909  cpu->percent_user.add(perc_milli);
910  }
911 
912  void cpu_sys(size_t perc_milli) noexcept override {
913  cpu->percent_sys.add(perc_milli);
914  }
915 
916  void cpu_threads(size_t threads) noexcept override {
917  cpu->nthreads.add(threads);
918  }
919 
920  uint64_t get_cpu_ms_interval() const noexcept override {
921  return reporting->cfg_intval->get() * 1000;
922  }
923 
924  } system;
925 
928 
929 };
930 
931 
932 
933 }}}}} // namespace SWC::Common::Query::Update::Metric
934 
935 
936 #endif // swcdb_common_queries_update_MetricsReporting_h
SWC::Common::Query::Update::Metric::Item_Mem::rss_used_reg
Common::Stats::MinMaxAvgCount_Safe< uint64_t > rss_used_reg
Definition: MetricsReporting.h:424
SWC::Common::Query::Update::Metric::Reporting::System::rss_free
void rss_free(size_t bytes) noexcept override
Definition: MetricsReporting.h:900
SWC::Core::Vector::front
constexpr SWC_CAN_INLINE reference front() noexcept
Definition: Vector.h:243
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:855
SWC::DB::Cells::Cell::set_value
SWC_CAN_INLINE void set_value(uint8_t *v, uint32_t len, bool owner)
Definition: Cell.h:223
SWC::Common::Query::Update::Metric::Item_Mem::Item_Mem
Item_Mem() noexcept
Definition: MetricsReporting.h:426
SWC::Common::Query::Update::Metric::Item_Net::Addr::conn_open
Core::Atomic< uint64_t > conn_open
Definition: MetricsReporting.h:98
SWC::FS::FileSystem::Ptr
std::shared_ptr< FileSystem > Ptr
Definition: FileSystem.h:98
SWC::client::Query::Update::Handlers::Metric::Reporting
Definition: Metrics.h:233
SWC::Common::Query::Update::Metric::Item_Mem::definitions
virtual void definitions(client::Query::Update::Handlers::Base::Column *colp, const DB::Cell::KeyVec &parent_key) override
Definition: MetricsReporting.h:430
SWC::Common::Stats::MinMaxAvgCount::count
ValueT count
Definition: Stat.h:19
SWC::Common::Stats::MinMaxAvgCount::total
ValueT total
Definition: Stat.h:20
SWC::Common::Query::Update::Metric::Item_FS::reset
virtual void reset() override
Definition: MetricsReporting.h:842
SWC::Common::Query::Update::Metric::Item_Net::Addr
Definition: MetricsReporting.h:96
SWC::Common::Query::Update::Metric::Reporting::Ptr
std::shared_ptr< Reporting > Ptr
Definition: MetricsReporting.h:853
SWC::client::Clients::DEFAULT
@ DEFAULT
Definition: Clients.h:61
SWC::Core::Atomic< uint64_t >
SWC::DB::Cell::KeyVec
Definition: CellKeyVec.h:21
SWC::Common::Query::Update::Metric::Reporting::mem
Item_Mem * mem
Definition: MetricsReporting.h:927
SWC::FS::Statistics::Metric::m_total
uint64_t m_total
Definition: Statistics.h:108
SWC::FS::Statistics::to_string
static const char *SWC_CONST_FUNC to_string(Command cmd) noexcept
Definition: Statistics.cc:64
SWC::System::Notifier
Definition: Resources.h:22
SWC::Common::Query::Update::Metric::Item_Net::disconnected
SWC_CAN_INLINE void disconnected(const Comm::ConnHandlerPtr &conn) noexcept
Definition: MetricsReporting.h:159
SWC::Comm::EndPoint
asio::ip::tcp::endpoint EndPoint
Definition: Resolver.h:19
SWC::Common::Query::Update::Metric::Item_Net::received
SWC_CAN_INLINE void received(const Comm::ConnHandlerPtr &conn, size_t bytes) noexcept
Definition: MetricsReporting.h:183
SWC::Common::Query::Update::Metric::Item_FS
Definition: MetricsReporting.h:679
SWC::Common::Query::Update::Metric::Item_Mem::rss_free
Common::Stats::MinMaxAvgCount_Safe< uint64_t > rss_free
Definition: MetricsReporting.h:422
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:864
SWC::client::Clients::Ptr
ClientsPtr Ptr
Definition: Clients.h:58
SWC::Comm::IoContextPtr
std::shared_ptr< IoContext > IoContextPtr
Definition: IoContext.h:16
SWC::Common::Stats::MinMaxAvgCount::avg
SWC_CAN_INLINE ValueT avg() const noexcept
Definition: Stat.h:40
SWC::Core::BufferDyn::ensure
SWC_CAN_INLINE void ensure(size_t len)
Definition: Buffer.h:201
SWC::client::Query::Update::Handlers::Metric::MIN
@ MIN
Definition: Metrics.h:28
SWC::Common::Query::Update::Metric::Item_Net::definitions
virtual void definitions(client::Query::Update::Handlers::Base::Column *colp, const DB::Cell::KeyVec &parent_key) override
Definition: MetricsReporting.h:188
SWC::Common::Query::Update::Metric::Item_Net::sent
SWC_CAN_INLINE void sent(const Comm::ConnHandlerPtr &conn, size_t bytes) noexcept
Definition: MetricsReporting.h:177
SWC::DB::Cells::Cell
Definition: Cell.h:92
SWC::Common::Query::Update::Metric::Item_Net::Addr::conn_est
Core::Atomic< uint64_t > conn_est
Definition: MetricsReporting.h:100
SWC::Common::Query::Update::Metric::Item_Net::get
SWC_CAN_INLINE Addr * get(const asio::ip::address &for_addr, bool secure) const noexcept
Definition: MetricsReporting.h:123
SWC::client::Query::Update::Handlers::Metric::MAX
@ MAX
Definition: Metrics.h:29
SWC::Config::Property::Value_int32_g::get
SWC_CAN_INLINE int32_t get() const noexcept
Definition: Property.h:605
SWC::Common::Query::Update::Metric::Item_CPU::reset
virtual void reset() override
Definition: MetricsReporting.h:669
SWC::DB::Cells::Cell::key
DB::Cell::Key key
Definition: Cell.h:357
SWC::Common::Query::Update::Metric::Reporting::System::reporting
Reporting * reporting
Definition: MetricsReporting.h:886
SWC::DB::Cell::Serial::Value::FieldsWriter::add
SWC_CAN_INLINE void add(Field *field)
Definition: CellValueSerialFields.h:42
SWC::Common::Query::Update::Metric::Item_Mem::Ptr
std::unique_ptr< Item_Mem > Ptr
Definition: MetricsReporting.h:420
SWC::Common::Query::Update::Metric::Item_Net::Addr::bytes_recv
Common::Stats::MinMaxAvgCount_Safe< uint64_t > bytes_recv
Definition: MetricsReporting.h:102
SWC::Common::Stats::MinMaxAvgCount_Safe< uint64_t >
SWC::Common::Stats::MinMaxAvgCount< uint64_t >
SWC::client::Query::Update::Handlers::Metric::Reporting::cfg_intval
Config::Property::Value_int32_g::Ptr cfg_intval
Definition: Metrics.h:239
SWC::DB::Cell::Key::add
SWC_CAN_INLINE void add(const std::string_view &fraction)
Definition: CellKey.h:86
SWC::client::Query::Update::Handlers::Metric::AVG
@ AVG
Definition: Metrics.h:30
SWC::Common::Query::Update::Metric::Item_Net::command
SWC_CAN_INLINE void command(const Comm::ConnHandlerPtr &conn, uint8_t cmd) noexcept
Definition: MetricsReporting.h:165
SWC::Common::Query::Update::Metric::Item_Net::Addr::addr
const asio::ip::address addr
Definition: MetricsReporting.h:97
SWC::FS::Statistics::Command
Command
Definition: Statistics.h:21
SWC::Core::Vector::empty
constexpr SWC_CAN_INLINE bool empty() const noexcept
Definition: Vector.h:168
SWC_CAN_INLINE
#define SWC_CAN_INLINE
Definition: Compat.h:102
SWC::Common::Query::Update::Metric::Item_Mem
Definition: MetricsReporting.h:402
SWC::Common::Query::Update::Metric::Reporting::System::cpu_user
void cpu_user(size_t perc_milli) noexcept override
Definition: MetricsReporting.h:908
SWC::Core::Buffer::base
value_type * base
Definition: Buffer.h:128
SWC::FS::Statistics::metrics
Metric metrics[Command::MAX]
Definition: Statistics.h:128
Metrics.h
SWC
The SWC-DB C++ namespace 'SWC'.
Definition: main.cc:12
SWC::Common::Query::Update::Metric::Item_Net::~Item_Net
virtual ~Item_Net() noexcept
Definition: MetricsReporting.h:120
SWC::DB::Cell::KeyVec::size
constexpr SWC_CAN_INLINE size_type size() const noexcept
Definition: Vector.h:189
SWC::Common::Query::Update::Metric::Item_Net::Addr::bytes_sent
Common::Stats::MinMaxAvgCount_Safe< uint64_t > bytes_sent
Definition: MetricsReporting.h:101
SWC::Common::Query::Update::Metric::Reporting::~Reporting
virtual ~Reporting() noexcept
Definition: MetricsReporting.h:882
SWC::Common::Query::Update::Metric::Item_CPU::percent_user
Common::Stats::MinMaxAvgCount_Safe< uint64_t > percent_user
Definition: MetricsReporting.h:560
SWC::Common::Query::Update::Metric::Item_CPU::Ptr
std::unique_ptr< Item_CPU > Ptr
Definition: MetricsReporting.h:558
SWC::Common::Query::Update::Metric::Item_FS::definitions
virtual void definitions(client::Query::Update::Handlers::Base::Column *colp, const DB::Cell::KeyVec &parent_key) override
Definition: MetricsReporting.h:700
SWC::client::Clients::Flag
Flag
Definition: Clients.h:60
SWC::Common::Query::Update::Metric::Item_CPU::report
virtual void report(uint64_t for_ns, client::Query::Update::Handlers::Base::Column *colp, const DB::Cell::KeyVec &parent_key) override
Definition: MetricsReporting.h:629
SWC::Common::Query::Update::Metric::Item_CPU::~Item_CPU
virtual ~Item_CPU() noexcept
Definition: MetricsReporting.h:566
SWC::client::Query::Update::Handlers::Metric::SUM
@ SUM
Definition: Metrics.h:27
SWC::client::Query::Update::Handlers::Base::Column
Definition: Base.h:30
SWC::Common::Query::Update::Metric::Reporting::cpu
Item_CPU * cpu
Definition: MetricsReporting.h:926
SWC::Common::Query::Update::Metric::Item_Net::Item_Net
Item_Net(const Comm::EndPoints &endpoints, bool using_secure)
Definition: MetricsReporting.h:112
SWC::DB::Cells::INSERT
@ INSERT
Definition: Cell.h:62
SWC::Common::Query::Update::Metric::Item_Mem::rss_used
Common::Stats::MinMaxAvgCount_Safe< uint64_t > rss_used
Definition: MetricsReporting.h:423
SWC::Common::Query::Update::Metric::Item_Net::accepted
SWC_CAN_INLINE void accepted(const Comm::EndPoint &endpoint, bool secure) noexcept
Definition: MetricsReporting.h:132
SWC::DB::Cells::Cell::set_time_order_desc
constexpr SWC_CAN_INLINE void set_time_order_desc(bool desc) noexcept
Definition: Cell.h:169
SWC::Common::Query::Update::Metric::Reporting::System::get_cpu_ms_interval
uint64_t get_cpu_ms_interval() const noexcept override
Definition: MetricsReporting.h:920
SWC::Serialization::encoded_length_vi64
constexpr SWC_CAN_INLINE uint8_t encoded_length_vi64(uint64_t val) noexcept
Definition: Serialization.h:272
SWC::client::Query::Update::Handlers::Metric::AVG_PROP
@ AVG_PROP
Definition: Metrics.h:31
SWC::Common::Query::Update::Metric::Item_FS::Ptr
std::unique_ptr< Item_FS > Ptr
Definition: MetricsReporting.h:693
encoded_length
uint8_t encoded_length() noexcept
SWC::Common::Query::Update::Metric::Item_Net::report
virtual void report(uint64_t for_ns, client::Query::Update::Handlers::Base::Column *colp, const DB::Cell::KeyVec &parent_key) override
Definition: MetricsReporting.h:306
SWC::Comm::ConnHandlerPtr
std::shared_ptr< ConnHandler > ConnHandlerPtr
Definition: AppContext.h:17
SWC::DB::Cell::Serial::Value::FieldsWriter
Definition: CellValueSerialFields.h:34
SWC::Common::Query::Update::Metric::Reporting::System::System
System(Reporting *a_reporting)
Definition: MetricsReporting.h:890
SWC::Common::Query::Update::Metric::Item_FS::Item_FS
Item_FS(const FS::FileSystem::Ptr &a_fs) noexcept
Definition: MetricsReporting.h:696
SWC::Core::Vector< EndPoint >
SWC::Common::Stats::MinMaxAvgCount_Safe::gather
SWC_CAN_INLINE void gather(MinMaxAvgCount< ValueT > &to) noexcept
Definition: Stat.h:102
SWC::Common::Query::Update::Metric::Item_Mem::report
virtual void report(uint64_t for_ns, client::Query::Update::Handlers::Base::Column *colp, const DB::Cell::KeyVec &parent_key) override
Definition: MetricsReporting.h:491
SWC::Common::Query::Update::Metric::Item_CPU
Definition: MetricsReporting.h:540
SWC::Common::Stats::MinMaxAvgCount::min
ValueT min
Definition: Stat.h:21
SWC::Core::BufferDyn::fill
constexpr SWC_CAN_INLINE size_t fill() const noexcept
Definition: Buffer.h:181
SWC::Common::Query::Update::Metric::Item_Mem::reset
virtual void reset() override
Definition: MetricsReporting.h:530
SWC::Common::Query::Update::Metric::Reporting::System::mem
Item_Mem * mem
Definition: MetricsReporting.h:888
SWC::Common::Query::Update::Metric::Reporting::System::cpu
Item_CPU * cpu
Definition: MetricsReporting.h:887
SWC::Common::Query::Update::Metric::Item_Net::Addr::conn_accept
Core::Atomic< uint64_t > conn_accept
Definition: MetricsReporting.h:99
SWC::Common::Query::Update::Metric::Reporting::System::rss_used_reg
void rss_used_reg(size_t bytes) noexcept override
Definition: MetricsReporting.h:896
SWC::Common::Query::Update::Metric::Reporting::System::cpu_sys
void cpu_sys(size_t perc_milli) noexcept override
Definition: MetricsReporting.h:912
SWC::Common::Query::Update::Metric::Item_Net::connected
SWC_CAN_INLINE void connected(const Comm::ConnHandlerPtr &conn) noexcept
Definition: MetricsReporting.h:151
SWC::Common::Query::Update::Metric::Item_CPU::Item_CPU
Item_CPU() noexcept
Definition: MetricsReporting.h:564
SWC::DB::Cell::KeyVec::copy
void copy(const KeyVec &other)
Definition: CellKeyVec.h:176
SWC::Common::Stats::MinMaxAvgCount::max
ValueT max
Definition: Stat.h:22
SWC::Common::Query::Update::Metric::Item_CPU::percent_sys
Common::Stats::MinMaxAvgCount_Safe< uint64_t > percent_sys
Definition: MetricsReporting.h:561
SWC::FS::Statistics
Definition: Statistics.h:18
SWC::Common::Query::Update::Metric::Item_Net::Ptr
std::unique_ptr< Item_Net > Ptr
Definition: MetricsReporting.h:94
SWC::Common::Query::Update::Metric::Reporting
Definition: MetricsReporting.h:850
SWC::Common::Query::Update::Metric::Reporting::System::rss_used
void rss_used(size_t bytes) noexcept override
Definition: MetricsReporting.h:904
SWC::Common::Query::Update::Metric::Item_Mem::~Item_Mem
virtual ~Item_Mem() noexcept
Definition: MetricsReporting.h:428
SWC::Common::Query::Update::Metric::Item_FS::report
virtual void report(uint64_t for_ns, client::Query::Update::Handlers::Base::Column *colp, const DB::Cell::KeyVec &parent_key) override
Definition: MetricsReporting.h:780
SWC::Common::Query::Update::Metric::Item_CPU::nthreads
Common::Stats::MinMaxAvgCount_Safe< uint64_t > nthreads
Definition: MetricsReporting.h:562
SWC::Common::Query::Update::Metric::Item_FS::~Item_FS
virtual ~Item_FS() noexcept
Definition: MetricsReporting.h:698
SWC::Common::Query::Update::Metric::Item_Net::connected
SWC_CAN_INLINE void connected() noexcept
Definition: MetricsReporting.h:138
SWC::Core::Vector::push_back
SWC_CAN_INLINE void push_back(ArgsT &&... args)
Definition: Vector.h:331
SWC::DB::Cell::KeyVec::add
SWC_CAN_INLINE void add(const Fraction &fraction)
Definition: CellKeyVec.h:57
SWC_ASSERT
#define SWC_ASSERT(_e_)
Definition: Exception.h:169
SWC::client::Query::Update::Handlers::Base::Column::add
virtual size_t add(const DynamicBuffer &cells, const DB::Cell::Key &upto_key, const DB::Cell::Key &from_key, uint32_t skip, bool malformed)=0
SWC::client::Query::Update::Handlers::Metric::Level
Definition: Metrics.h:80
SWC::Common::Query::Update::Metric::Item_Net
Definition: MetricsReporting.h:72
SWC::Core::to_string
SWC_CAN_INLINE std::string to_string(const BitFieldInt< T, SZ > &v)
Definition: BitFieldInt.h:263
SWC::Common::Query::Update::Metric::Item_Net::error
SWC_CAN_INLINE void error(const Comm::ConnHandlerPtr &conn) noexcept
Definition: MetricsReporting.h:171
SWC::Common::Stats::MinMaxAvgCount_Safe::reset
SWC_CAN_INLINE void reset() noexcept
Definition: Stat.h:108
SWC::Core::Vector::size
constexpr SWC_CAN_INLINE size_type size() const noexcept
Definition: Vector.h:189
SWC::client::Query::Update::Handlers::Metric::Base
Definition: Metrics.h:46
Interface.h
Resources.h
SWC::Common::Query::Update::Metric::Reporting::System
Definition: MetricsReporting.h:885
SWC::Common::Query::Update::Metric::Item_Net::reset
virtual void reset() override
Definition: MetricsReporting.h:375
SWC::Common::Query::Update::Metric::Item_Net::disconnected
SWC_CAN_INLINE void disconnected() noexcept
Definition: MetricsReporting.h:145
SWC::Common::Query::Update::Metric::Item_FS::fs
FS::FileSystem::Ptr fs
Definition: MetricsReporting.h:694
SWC::Common::Query::Update::Metric::Reporting::System::cpu_threads
void cpu_threads(size_t threads) noexcept override
Definition: MetricsReporting.h:916
SWC::Common::Query::Update::Metric::Item_CPU::definitions
virtual void definitions(client::Query::Update::Handlers::Base::Column *colp, const DB::Cell::KeyVec &parent_key) override
Definition: MetricsReporting.h:568
SWC::Config::Property::Value_int32_g
Definition: Property.h:581
SWC::Core::Vector::reserve
SWC_CAN_INLINE void reserve(size_type cap)
Definition: Vector.h:288
SWC::DB::Cells::Cell::flag
uint8_t flag
Definition: Cell.h:359
SWC::FS::to_string
const char *SWC_CONST_FUNC to_string(Type typ) noexcept
Definition: FileSystem.cc:47
SWC::Common::Query::Update::Metric::Item_Net::Addr::Addr
SWC_CAN_INLINE Addr(const Comm::EndPoint &endpoint) noexcept
Definition: MetricsReporting.h:106
SWC::Common::Stats::MinMaxAvgCount_Safe::add
SWC_CAN_INLINE void add(ValueT v) noexcept
Definition: Stat.h:66
SWC::DB::Cells::Cell::set_timestamp
constexpr SWC_CAN_INLINE void set_timestamp(int64_t ts) noexcept
Definition: Cell.h:182