aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/monlib/counters/counters.cpp
diff options
context:
space:
mode:
authormonster <monster@ydb.tech>2022-07-07 14:41:37 +0300
committermonster <monster@ydb.tech>2022-07-07 14:41:37 +0300
commit06e5c21a835c0e923506c4ff27929f34e00761c2 (patch)
tree75efcbc6854ef9bd476eb8bf00cc5c900da436a2 /library/cpp/monlib/counters/counters.cpp
parent03f024c4412e3aa613bb543cf1660176320ba8f4 (diff)
downloadydb-06e5c21a835c0e923506c4ff27929f34e00761c2.tar.gz
fix ya.make
Diffstat (limited to 'library/cpp/monlib/counters/counters.cpp')
-rw-r--r--library/cpp/monlib/counters/counters.cpp49
1 files changed, 0 insertions, 49 deletions
diff --git a/library/cpp/monlib/counters/counters.cpp b/library/cpp/monlib/counters/counters.cpp
deleted file mode 100644
index 50dca4c577a..00000000000
--- a/library/cpp/monlib/counters/counters.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-
-#include "counters.h"
-
-namespace NMonitoring {
- char* PrettyNumShort(i64 val, char* buf, size_t size) {
- static const char shorts[] = {' ', 'K', 'M', 'G', 'T', 'P', 'E'};
- unsigned i = 0;
- i64 major = val;
- i64 minor = 0;
- const unsigned imax = sizeof(shorts) / sizeof(char);
- for (i = 0; i < imax; i++) {
- if (major >> 10 == 0)
- break;
- else {
- minor = major - (major >> 10 << 10);
- major = major >> 10;
- }
- }
- minor = (minor * 10) >> 10;
-
- if (i == 0 || i >= imax)
- *buf = '\0';
- else
- snprintf(buf, size, "%" PRId64 ".%" PRId64 "%c", major, minor, shorts[i]);
-
- return buf;
- }
-
- char* PrettyNum(i64 val, char* buf, size_t size) {
- Y_ASSERT(buf);
- if (size < 4) {
- buf[0] = 0;
- return buf;
- }
- PrettyNumShort(val, buf + 2, size - 3);
- if (buf[2] == 0) {
- *buf = '\0';
- } else {
- size_t len = 2 + strnlen(buf + 2, size - 4);
- Y_ASSERT(len < size);
- buf[0] = ' ';
- buf[1] = '(';
- buf[len] = ')';
- buf[len + 1] = '\0';
- }
-
- return buf;
- }
-}