diff options
author | danlark <danlark@yandex-team.ru> | 2022-02-10 16:46:10 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:10 +0300 |
commit | baa58daefa91fde4b4769facdbd2903763b9c6a8 (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/monlib/encode | |
parent | 3426a9bc7f169ae9da54cef557ad2a33f6e8eee0 (diff) | |
download | ydb-baa58daefa91fde4b4769facdbd2903763b9c6a8.tar.gz |
Restoring authorship annotation for <danlark@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/monlib/encode')
5 files changed, 33 insertions, 33 deletions
diff --git a/library/cpp/monlib/encode/buffered/string_pool.cpp b/library/cpp/monlib/encode/buffered/string_pool.cpp index 35b0b6d114..b4c7988ba3 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 b093f03516..400ce5a643 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 d9e39d516a..f87a2d7e8f 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 595af2b504..0d2152fc85 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 4f45106e60..b2344b0905 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(); } |