aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/monlib
diff options
context:
space:
mode:
authordanlark <danlark@yandex-team.ru>2022-02-10 16:46:08 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:08 +0300
commit3426a9bc7f169ae9da54cef557ad2a33f6e8eee0 (patch)
tree26154e1e9990f1bb4525d3e3fb5b6dac2c2c1da2 /library/cpp/monlib
parentcb68f224c46a8ee52ac3fdd2a32534b8bb8dc134 (diff)
downloadydb-3426a9bc7f169ae9da54cef557ad2a33f6e8eee0.tar.gz
Restoring authorship annotation for <danlark@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/monlib')
-rw-r--r--library/cpp/monlib/dynamic_counters/encode.cpp4
-rw-r--r--library/cpp/monlib/dynamic_counters/golovan_page.cpp2
-rw-r--r--library/cpp/monlib/dynamic_counters/page.cpp2
-rw-r--r--library/cpp/monlib/encode/buffered/string_pool.cpp2
-rw-r--r--library/cpp/monlib/encode/format.cpp2
-rw-r--r--library/cpp/monlib/encode/legacy_protobuf/legacy_proto_decoder.cpp6
-rw-r--r--library/cpp/monlib/encode/spack/compression.cpp50
-rw-r--r--library/cpp/monlib/encode/unistat/unistat_decoder.cpp6
-rw-r--r--library/cpp/monlib/service/format.h2
-rw-r--r--library/cpp/monlib/service/pages/index_mon_page.cpp2
-rw-r--r--library/cpp/monlib/service/pages/mon_page.h2
-rw-r--r--library/cpp/monlib/service/pages/registry_mon_page.cpp2
-rw-r--r--library/cpp/monlib/service/pages/templates.h54
-rw-r--r--library/cpp/monlib/service/service.cpp16
14 files changed, 76 insertions, 76 deletions
diff --git a/library/cpp/monlib/dynamic_counters/encode.cpp b/library/cpp/monlib/dynamic_counters/encode.cpp
index ffa48d276e..cf09311cc6 100644
--- a/library/cpp/monlib/dynamic_counters/encode.cpp
+++ b/library/cpp/monlib/dynamic_counters/encode.cpp
@@ -53,7 +53,7 @@ namespace NMonitoring {
void OnGroupBegin(
const TString& labelName, const TString& labelValue,
const TDynamicCounters*) override {
- if (labelName.empty() && labelValue.empty()) {
+ if (labelName.empty() && labelValue.empty()) {
// root group has empty label name and value
EncoderImpl_->OnStreamBegin();
} else {
@@ -64,7 +64,7 @@ namespace NMonitoring {
void OnGroupEnd(
const TString& labelName, const TString& labelValue,
const TDynamicCounters*) override {
- if (labelName.empty() && labelValue.empty()) {
+ if (labelName.empty() && labelValue.empty()) {
// root group has empty label name and value
EncoderImpl_->OnStreamEnd();
EncoderImpl_->Close();
diff --git a/library/cpp/monlib/dynamic_counters/golovan_page.cpp b/library/cpp/monlib/dynamic_counters/golovan_page.cpp
index 49cf2d39bb..b33e4c3871 100644
--- a/library/cpp/monlib/dynamic_counters/golovan_page.cpp
+++ b/library/cpp/monlib/dynamic_counters/golovan_page.cpp
@@ -44,7 +44,7 @@ public:
void OnGroupBegin(const TString&, const TString& value, const TDynamicCounters*) override {
prefix += value;
- if (!value.empty()) {
+ if (!value.empty()) {
prefix += "_";
}
}
diff --git a/library/cpp/monlib/dynamic_counters/page.cpp b/library/cpp/monlib/dynamic_counters/page.cpp
index 5124a47bb3..a3517a4556 100644
--- a/library/cpp/monlib/dynamic_counters/page.cpp
+++ b/library/cpp/monlib/dynamic_counters/page.cpp
@@ -4,7 +4,7 @@
#include <library/cpp/monlib/service/pages/templates.h>
#include <library/cpp/string_utils/quote/quote.h>
-#include <util/string/split.h>
+#include <util/string/split.h>
#include <util/system/tls.h>
using namespace NMonitoring;
diff --git a/library/cpp/monlib/encode/buffered/string_pool.cpp b/library/cpp/monlib/encode/buffered/string_pool.cpp
index b4c7988ba3..35b0b6d114 100644
--- a/library/cpp/monlib/encode/buffered/string_pool.cpp
+++ b/library/cpp/monlib/encode/buffered/string_pool.cpp
@@ -9,7 +9,7 @@ namespace NMonitoring {
auto [it, isInserted] = StrMap_.try_emplace(str, Max<ui32>(), 0);
if (isInserted) {
- BytesSize_ += str.size();
+ BytesSize_ += str.size();
it->second.Index = StrVector_.size();
StrVector_.emplace_back(it->first, &it->second);
}
diff --git a/library/cpp/monlib/encode/format.cpp b/library/cpp/monlib/encode/format.cpp
index 400ce5a643..b093f03516 100644
--- a/library/cpp/monlib/encode/format.cpp
+++ b/library/cpp/monlib/encode/format.cpp
@@ -1,7 +1,7 @@
#include "format.h"
#include <util/string/ascii.h>
-#include <util/string/split.h>
+#include <util/string/split.h>
#include <util/string/strip.h>
#include <util/stream/output.h>
#include <util/string/cast.h>
diff --git a/library/cpp/monlib/encode/legacy_protobuf/legacy_proto_decoder.cpp b/library/cpp/monlib/encode/legacy_protobuf/legacy_proto_decoder.cpp
index f87a2d7e8f..d9e39d516a 100644
--- a/library/cpp/monlib/encode/legacy_protobuf/legacy_proto_decoder.cpp
+++ b/library/cpp/monlib/encode/legacy_protobuf/legacy_proto_decoder.cpp
@@ -7,7 +7,7 @@
#include <util/generic/yexception.h>
#include <util/generic/maybe.h>
#include <util/datetime/base.h>
-#include <util/string/split.h>
+#include <util/string/split.h>
#include <google/protobuf/reflection.h>
@@ -256,7 +256,7 @@ namespace NMonitoring {
return !maybeMeta->HasPath() || maybeMeta->GetPath();
};
- if (!name.empty() && (!maybeMeta || usePath())) {
+ if (!name.empty() && (!maybeMeta || usePath())) {
child.AppendPath(name);
}
@@ -495,7 +495,7 @@ namespace NMonitoring {
Consumer_->OnLabel(label.Name(), label.Value());
}
- const auto fullPath = name.empty()
+ const auto fullPath = name.empty()
? ctx.Path()
: ctx.Path() + '/' + name;
diff --git a/library/cpp/monlib/encode/spack/compression.cpp b/library/cpp/monlib/encode/spack/compression.cpp
index 0d2152fc85..595af2b504 100644
--- a/library/cpp/monlib/encode/spack/compression.cpp
+++ b/library/cpp/monlib/encode/spack/compression.cpp
@@ -44,13 +44,13 @@ namespace NMonitoring {
struct TBlock: public TStringBuf {
template <typename T>
TBlock(T&& t)
- : TStringBuf(t.data(), t.size())
+ : TStringBuf(t.data(), t.size())
{
Y_ENSURE(t.data() != nullptr);
}
- char* data() noexcept {
- return const_cast<char*>(TStringBuf::data());
+ char* data() noexcept {
+ return const_cast<char*>(TStringBuf::data());
}
};
@@ -73,7 +73,7 @@ namespace NMonitoring {
///////////////////////////////////////////////////////////////////////////////
struct TAdler32 {
static TCheckSum Calc(TBlock in) {
- return adler32(1L, reinterpret_cast<const Bytef*>(in.data()), in.size());
+ return adler32(1L, reinterpret_cast<const Bytef*>(in.data()), in.size());
}
static bool Check(TBlock in, TCheckSum checksum) {
@@ -93,20 +93,20 @@ namespace NMonitoring {
static size_t Compress(TBlock in, TBlock out) {
int rc = LZ4_compress_default(
- in.data(),
- out.data(),
- SafeIntegerCast<int>(in.size()),
- SafeIntegerCast<int>(out.size()));
+ in.data(),
+ out.data(),
+ SafeIntegerCast<int>(in.size()),
+ SafeIntegerCast<int>(out.size()));
Y_ENSURE(rc != 0, "lz4 compression failed");
return rc;
}
static void Decompress(TBlock in, TBlock out) {
int rc = LZ4_decompress_safe(
- in.data(),
- out.data(),
- SafeIntegerCast<int>(in.size()),
- SafeIntegerCast<int>(out.size()));
+ in.data(),
+ out.data(),
+ SafeIntegerCast<int>(in.size()),
+ SafeIntegerCast<int>(out.size()));
Y_ENSURE(rc >= 0, "the lz4 stream is detected malformed");
}
};
@@ -122,7 +122,7 @@ namespace NMonitoring {
}
static size_t Compress(TBlock in, TBlock out) {
- size_t rc = ZSTD_compress(out.data(), out.size(), in.data(), in.size(), LEVEL);
+ size_t rc = ZSTD_compress(out.data(), out.size(), in.data(), in.size(), LEVEL);
if (Y_UNLIKELY(ZSTD_isError(rc))) {
ythrow yexception() << TStringBuf("zstd compression failed: ")
<< ZSTD_getErrorName(rc);
@@ -131,12 +131,12 @@ namespace NMonitoring {
}
static void Decompress(TBlock in, TBlock out) {
- size_t rc = ZSTD_decompress(out.data(), out.size(), in.data(), in.size());
+ size_t rc = ZSTD_decompress(out.data(), out.size(), in.data(), in.size());
if (Y_UNLIKELY(ZSTD_isError(rc))) {
ythrow yexception() << TStringBuf("zstd decompression failed: ")
<< ZSTD_getErrorName(rc);
}
- Y_ENSURE(rc == out.size(), "zstd decompressed wrong size");
+ Y_ENSURE(rc == out.size(), "zstd decompressed wrong size");
}
};
@@ -151,26 +151,26 @@ namespace NMonitoring {
}
static size_t Compress(TBlock in, TBlock out) {
- uLong ret = out.size();
+ uLong ret = out.size();
int rc = compress2(
- reinterpret_cast<Bytef*>(out.data()),
+ reinterpret_cast<Bytef*>(out.data()),
&ret,
- reinterpret_cast<const Bytef*>(in.data()),
- in.size(),
+ reinterpret_cast<const Bytef*>(in.data()),
+ in.size(),
LEVEL);
Y_ENSURE(rc == Z_OK, "zlib compression failed");
return ret;
}
static void Decompress(TBlock in, TBlock out) {
- uLong ret = out.size();
+ uLong ret = out.size();
int rc = uncompress(
- reinterpret_cast<Bytef*>(out.data()),
+ reinterpret_cast<Bytef*>(out.data()),
&ret,
- reinterpret_cast<const Bytef*>(in.data()),
- in.size());
+ reinterpret_cast<const Bytef*>(in.data()),
+ in.size());
Y_ENSURE(rc == Z_OK, "zlib decompression failed");
- Y_ENSURE(ret == out.size(), "zlib decompressed wrong size");
+ Y_ENSURE(ret == out.size(), "zlib decompressed wrong size");
}
};
@@ -321,7 +321,7 @@ namespace NMonitoring {
// add header
auto header = reinterpret_cast<TFrameHeader*>(Frame_.Data());
- header->CompressedSize = SafeIntegerCast<TCompressedSize>(compressedBlock.size());
+ header->CompressedSize = SafeIntegerCast<TCompressedSize>(compressedBlock.size());
header->UncompressedSize = SafeIntegerCast<TUncompressedSize>(Uncompressed_.Size());
// add footer
diff --git a/library/cpp/monlib/encode/unistat/unistat_decoder.cpp b/library/cpp/monlib/encode/unistat/unistat_decoder.cpp
index b2344b0905..4f45106e60 100644
--- a/library/cpp/monlib/encode/unistat/unistat_decoder.cpp
+++ b/library/cpp/monlib/encode/unistat/unistat_decoder.cpp
@@ -9,7 +9,7 @@
#include <library/cpp/json/json_reader.h>
#include <util/datetime/base.h>
-#include <util/string/split.h>
+#include <util/string/split.h>
#include <contrib/libs/re2/re2/re2.h>
@@ -174,7 +174,7 @@ namespace NMonitoring {
TStringBuf name = parts.back();
parts.pop_back();
- Y_ENSURE(RE2::FullMatch(re2::StringPiece{name.data(), name.size()}, NAME_RE),
+ Y_ENSURE(RE2::FullMatch(re2::StringPiece{name.data(), name.size()}, NAME_RE),
"Metric name " << name << " doesn't match regex " << NAME_RE.pattern());
MetricContext_.Name = name;
@@ -246,7 +246,7 @@ namespace NMonitoring {
}
void DecodeUnistatToStream(TStringBuf data, IMetricConsumer* c, TInstant ts) {
- TMemoryInput in{data.data(), data.size()};
+ TMemoryInput in{data.data(), data.size()};
TDecoderUnistat decoder(c, &in, ts);
decoder.Decode();
}
diff --git a/library/cpp/monlib/service/format.h b/library/cpp/monlib/service/format.h
index 0044b586b1..990b953945 100644
--- a/library/cpp/monlib/service/format.h
+++ b/library/cpp/monlib/service/format.h
@@ -48,7 +48,7 @@ namespace NMonitoring {
auto&& formatStr = req.GetParams()
.Get(TStringBuf("format"));
- if (!formatStr.empty()) {
+ if (!formatStr.empty()) {
if (formatStr == TStringBuf("SPACK")) {
return EFormat::SPACK;
} else if (formatStr == TStringBuf("TEXT")) {
diff --git a/library/cpp/monlib/service/pages/index_mon_page.cpp b/library/cpp/monlib/service/pages/index_mon_page.cpp
index 83ff8b529a..582eac2908 100644
--- a/library/cpp/monlib/service/pages/index_mon_page.cpp
+++ b/library/cpp/monlib/service/pages/index_mon_page.cpp
@@ -32,7 +32,7 @@ void TIndexMonPage::Output(IMonHttpRequest& request) {
if (i != PagesByPath.end()) {
found = i->second;
pathInfo = request.GetPathInfo().substr(pathTmp.size());
- Y_VERIFY(pathInfo.empty() || pathInfo.StartsWith('/'));
+ Y_VERIFY(pathInfo.empty() || pathInfo.StartsWith('/'));
break;
}
size_t slash = pathTmp.find_last_of('/');
diff --git a/library/cpp/monlib/service/pages/mon_page.h b/library/cpp/monlib/service/pages/mon_page.h
index e396612bb0..9903a16670 100644
--- a/library/cpp/monlib/service/pages/mon_page.h
+++ b/library/cpp/monlib/service/pages/mon_page.h
@@ -57,7 +57,7 @@ namespace NMonitoring {
}
bool IsInIndex() const {
- return !Title.empty();
+ return !Title.empty();
}
virtual void Output(IMonHttpRequest& request) = 0;
diff --git a/library/cpp/monlib/service/pages/registry_mon_page.cpp b/library/cpp/monlib/service/pages/registry_mon_page.cpp
index c59e50f622..294e140d92 100644
--- a/library/cpp/monlib/service/pages/registry_mon_page.cpp
+++ b/library/cpp/monlib/service/pages/registry_mon_page.cpp
@@ -11,7 +11,7 @@ namespace NMonitoring {
const auto formatStr = TStringBuf{request.GetPathInfo()}.RNextTok('/');
auto& out = request.Output();
- if (!formatStr.empty()) {
+ if (!formatStr.empty()) {
IMetricEncoderPtr encoder;
TString resp;
diff --git a/library/cpp/monlib/service/pages/templates.h b/library/cpp/monlib/service/pages/templates.h
index b4656f059f..f1479b643f 100644
--- a/library/cpp/monlib/service/pages/templates.h
+++ b/library/cpp/monlib/service/pages/templates.h
@@ -204,33 +204,33 @@ namespace NMonitoring {
IOutputStream& Str;
};
- extern const char HtmlTag[5];
- extern const char HeadTag[5];
- extern const char BodyTag[5];
- extern const char DivTag[4];
- extern const char TableTag[6];
- extern const char TableHeadTag[6];
- extern const char TableBodyTag[6];
- extern const char TableRTag[3];
- extern const char TableDTag[3];
- extern const char TableHTag[3];
- extern const char FormTag[5];
- extern const char LabelTag[6];
- extern const char SpanTag[5];
- extern const char CaptionTag[8];
- extern const char PreTag[4];
- extern const char ParaTag[2];
- extern const char H1Tag[3];
- extern const char H2Tag[3];
- extern const char H3Tag[3];
- extern const char H4Tag[3];
- extern const char H5Tag[3];
- extern const char H6Tag[3];
- extern const char SmallTag[6];
- extern const char StrongTag[7];
- extern const char ListTag[3];
- extern const char UListTag[3];
- extern const char OListTag[3];
+ extern const char HtmlTag[5];
+ extern const char HeadTag[5];
+ extern const char BodyTag[5];
+ extern const char DivTag[4];
+ extern const char TableTag[6];
+ extern const char TableHeadTag[6];
+ extern const char TableBodyTag[6];
+ extern const char TableRTag[3];
+ extern const char TableDTag[3];
+ extern const char TableHTag[3];
+ extern const char FormTag[5];
+ extern const char LabelTag[6];
+ extern const char SpanTag[5];
+ extern const char CaptionTag[8];
+ extern const char PreTag[4];
+ extern const char ParaTag[2];
+ extern const char H1Tag[3];
+ extern const char H2Tag[3];
+ extern const char H3Tag[3];
+ extern const char H4Tag[3];
+ extern const char H5Tag[3];
+ extern const char H6Tag[3];
+ extern const char SmallTag[6];
+ extern const char StrongTag[7];
+ extern const char ListTag[3];
+ extern const char UListTag[3];
+ extern const char OListTag[3];
extern const char DListTag[3];
extern const char DTermTag[3];
extern const char DDescTag[3];
diff --git a/library/cpp/monlib/service/service.cpp b/library/cpp/monlib/service/service.cpp
index 929efbf816..8a7d8b01ea 100644
--- a/library/cpp/monlib/service/service.cpp
+++ b/library/cpp/monlib/service/service.cpp
@@ -21,11 +21,11 @@ namespace NMonitoring {
RemoteAddr = remoteAddr;
THttpHeaderParser parser;
parser.Init(&Header);
- if (parser.Execute(in.FirstLine().data(), in.FirstLine().size()) < 0) {
+ if (parser.Execute(in.FirstLine().data(), in.FirstLine().size()) < 0) {
out << "HTTP/1.1 400 Bad request\r\nConnection: Close\r\n\r\n";
return;
}
- if (Url.Parse(Header.GetUrl().data()) != THttpURL::ParsedOK) {
+ if (Url.Parse(Header.GetUrl().data()) != THttpURL::ParsedOK) {
out << "HTTP/1.1 400 Invalid url\r\nConnection: Close\r\n\r\n";
return;
}
@@ -38,7 +38,7 @@ namespace NMonitoring {
CgiParams.Scan(Url.Get(THttpURL::FieldQuery));
} catch (...) {
out << "HTTP/1.1 500 Internal server error\r\nConnection: Close\r\n\r\n";
- YSYSLOG(TLOG_ERR, "THttpClient: internal error while serving monitoring request: %s", CurrentExceptionMessage().data());
+ YSYSLOG(TLOG_ERR, "THttpClient: internal error while serving monitoring request: %s", CurrentExceptionMessage().data());
}
if (Header.http_method == HTTP_METHOD_POST)
@@ -75,7 +75,7 @@ namespace NMonitoring {
return (HTTP_METHOD)Header.http_method;
}
void ScanPostParams() {
- PostParams.Scan(TStringBuf(PostContent.Buffer().data(), PostContent.Buffer().size()));
+ PostParams.Scan(TStringBuf(PostContent.Buffer().data(), PostContent.Buffer().size()));
}
const THttpHeaders& GetHeaders() const override {
@@ -123,7 +123,7 @@ namespace NMonitoring {
out << s.Str();
out.Finish();
} catch (...) {
- YSYSLOG(TLOG_WARNING, "TCoHttpServer::TConnection: error: %s\n", CurrentExceptionMessage().data());
+ YSYSLOG(TLOG_WARNING, "TCoHttpServer::TConnection: error: %s\n", CurrentExceptionMessage().data());
}
}
@@ -143,7 +143,7 @@ namespace NMonitoring {
try {
Listener.Bind(TIpAddress(bindAddr, port));
} catch (yexception e) {
- Y_FAIL("TCoHttpServer::TCoHttpServer: couldn't bind to %s:%d\n", bindAddr.data(), port);
+ Y_FAIL("TCoHttpServer::TCoHttpServer: couldn't bind to %s:%d\n", bindAddr.data(), port);
}
}
@@ -177,11 +177,11 @@ namespace NMonitoring {
out << "HTTP/1.1 200 Ok\nConnection: Close\n\n";
TransferData(&http_in, &out);
} catch (...) {
- YSYSLOG(TLOG_DEBUG, "TCoHttpServer: while getting data from backend: %s", CurrentExceptionMessage().data());
+ YSYSLOG(TLOG_DEBUG, "TCoHttpServer: while getting data from backend: %s", CurrentExceptionMessage().data());
}
} catch (const yexception& /*e*/) {
out << "HTTP/1.1 500 Internal server error\nConnection: Close\n\n";
- YSYSLOG(TLOG_DEBUG, "TCoHttpServer: while getting data from backend: %s", CurrentExceptionMessage().data());
+ YSYSLOG(TLOG_DEBUG, "TCoHttpServer: while getting data from backend: %s", CurrentExceptionMessage().data());
}
}