diff options
author | yazevnul <yazevnul@yandex-team.ru> | 2022-02-10 16:46:48 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:48 +0300 |
commit | 9abfb1a53b7f7b791444d1378e645d8fad9b06ed (patch) | |
tree | 49e222ea1c5804306084bb3ae065bb702625360f /library/cpp/monlib | |
parent | 8cbc307de0221f84c80c42dcbe07d40727537e2c (diff) | |
download | ydb-9abfb1a53b7f7b791444d1378e645d8fad9b06ed.tar.gz |
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/monlib')
25 files changed, 83 insertions, 83 deletions
diff --git a/library/cpp/monlib/counters/counters.cpp b/library/cpp/monlib/counters/counters.cpp index bda7f8c404..50dca4c577 100644 --- a/library/cpp/monlib/counters/counters.cpp +++ b/library/cpp/monlib/counters/counters.cpp @@ -27,7 +27,7 @@ namespace NMonitoring { } char* PrettyNum(i64 val, char* buf, size_t size) { - Y_ASSERT(buf); + Y_ASSERT(buf); if (size < 4) { buf[0] = 0; return buf; @@ -37,7 +37,7 @@ namespace NMonitoring { *buf = '\0'; } else { size_t len = 2 + strnlen(buf + 2, size - 4); - Y_ASSERT(len < size); + Y_ASSERT(len < size); buf[0] = ' '; buf[1] = '('; buf[len] = ')'; diff --git a/library/cpp/monlib/counters/counters_ut.cpp b/library/cpp/monlib/counters/counters_ut.cpp index 4d488b3ece..2845efb97b 100644 --- a/library/cpp/monlib/counters/counters_ut.cpp +++ b/library/cpp/monlib/counters/counters_ut.cpp @@ -8,7 +8,7 @@ using namespace NMonitoring; Y_UNIT_TEST_SUITE(TDeprecatedCountersTest) { - Y_UNIT_TEST(CounterGroupsAreThreadSafe) { + Y_UNIT_TEST(CounterGroupsAreThreadSafe) { const static ui32 GROUPS_COUNT = 1000; const static ui32 THREADS_COUNT = 10; diff --git a/library/cpp/monlib/counters/histogram_ut.cpp b/library/cpp/monlib/counters/histogram_ut.cpp index 890063c577..5a0800505a 100644 --- a/library/cpp/monlib/counters/histogram_ut.cpp +++ b/library/cpp/monlib/counters/histogram_ut.cpp @@ -4,8 +4,8 @@ using namespace NMonitoring; -Y_UNIT_TEST_SUITE(THistorgamTest) { - Y_UNIT_TEST(TakeSnapshot) { +Y_UNIT_TEST_SUITE(THistorgamTest) { + Y_UNIT_TEST(TakeSnapshot) { THdrHistogram h(1, 10, 3); UNIT_ASSERT(h.RecordValue(1)); UNIT_ASSERT(h.RecordValue(2)); diff --git a/library/cpp/monlib/counters/meter_ut.cpp b/library/cpp/monlib/counters/meter_ut.cpp index 96ff37e2f5..b507d16fbd 100644 --- a/library/cpp/monlib/counters/meter_ut.cpp +++ b/library/cpp/monlib/counters/meter_ut.cpp @@ -18,8 +18,8 @@ struct TMockClock { using TMockMeter = TMeterImpl<TMockClock>; -Y_UNIT_TEST_SUITE(TMeterTest) { - Y_UNIT_TEST(StartsOutWithNoRatesOrCount) { +Y_UNIT_TEST_SUITE(TMeterTest) { + Y_UNIT_TEST(StartsOutWithNoRatesOrCount) { TMeter meter; UNIT_ASSERT_EQUAL(meter.GetCount(), 0L); UNIT_ASSERT_DOUBLES_EQUAL(meter.GetMeanRate(), 0.0, 0.0001); @@ -28,7 +28,7 @@ Y_UNIT_TEST_SUITE(TMeterTest) { UNIT_ASSERT_DOUBLES_EQUAL(meter.GetFifteenMinutesRate(), 0.0, 0.0001); } - Y_UNIT_TEST(MarksEventsAndUpdatesRatesAndCount) { + Y_UNIT_TEST(MarksEventsAndUpdatesRatesAndCount) { TMockMeter meter; meter.Mark(); meter.Mark(2); diff --git a/library/cpp/monlib/counters/timer_ut.cpp b/library/cpp/monlib/counters/timer_ut.cpp index cdd8bc494d..c5cd07e89d 100644 --- a/library/cpp/monlib/counters/timer_ut.cpp +++ b/library/cpp/monlib/counters/timer_ut.cpp @@ -16,8 +16,8 @@ public: int Value_; }; -Y_UNIT_TEST_SUITE(TTimerTest) { - Y_UNIT_TEST(RecordValue) { +Y_UNIT_TEST_SUITE(TTimerTest) { + Y_UNIT_TEST(RecordValue) { TTimerNs timerNs(1ns, 1s); UNIT_ASSERT(timerNs.RecordValue(10us)); @@ -36,7 +36,7 @@ Y_UNIT_TEST_SUITE(TTimerTest) { UNIT_ASSERT_DOUBLES_EQUAL(snapshot.StdDeviation, 0.0, 1e-6); } - Y_UNIT_TEST(Measure) { + Y_UNIT_TEST(Measure) { TTimerNs timer(1ns, 1s); timer.Measure([]() { Sleep(TDuration::MilliSeconds(1)); @@ -49,7 +49,7 @@ Y_UNIT_TEST_SUITE(TTimerTest) { UNIT_ASSERT_DOUBLES_EQUAL(snapshot.StdDeviation, 0.0, 1e-6); } - Y_UNIT_TEST(TimerScope) { + Y_UNIT_TEST(TimerScope) { TTimerUs timer(1us, 1000s); { TTimerScope<TTimerUs> scope(&timer); @@ -63,7 +63,7 @@ Y_UNIT_TEST_SUITE(TTimerTest) { UNIT_ASSERT_DOUBLES_EQUAL(snapshot.StdDeviation, 0.0, 1e-6); } - Y_UNIT_TEST(TimerScopeWithCallback) { + Y_UNIT_TEST(TimerScopeWithCallback) { TCallback callback(0); TTimerUs timer(1us, 1000s); { diff --git a/library/cpp/monlib/deprecated/json/writer_ut.cpp b/library/cpp/monlib/deprecated/json/writer_ut.cpp index 39b199d251..1f9fc8f393 100644 --- a/library/cpp/monlib/deprecated/json/writer_ut.cpp +++ b/library/cpp/monlib/deprecated/json/writer_ut.cpp @@ -5,7 +5,7 @@ using namespace NMonitoring; Y_UNIT_TEST_SUITE(JsonWriterTests) { - Y_UNIT_TEST(One) { + Y_UNIT_TEST(One) { TStringStream ss; TDeprecatedJsonWriter w(&ss); w.OpenDocument(); diff --git a/library/cpp/monlib/dynamic_counters/counters.cpp b/library/cpp/monlib/dynamic_counters/counters.cpp index 339b6c3a07..3635d87d0d 100644 --- a/library/cpp/monlib/dynamic_counters/counters.cpp +++ b/library/cpp/monlib/dynamic_counters/counters.cpp @@ -153,7 +153,7 @@ void TDynamicCounters::MergeWithSubgroup(const TString& name, const TString& val auto it = Counters.find({name, value}); Y_VERIFY(it != Counters.end()); TIntrusivePtr<TDynamicCounters> subgroup = AsDynamicCounters(it->second); - Y_VERIFY(subgroup); + Y_VERIFY(subgroup); Counters.erase(it); Counters.merge(subgroup->Resign()); AtomicAdd(ExpiringCount, AtomicSwap(&subgroup->ExpiringCount, 0)); @@ -200,7 +200,7 @@ void TDynamicCounters::EnumerateSubgroups(const std::function<void(const TString } } -void TDynamicCounters::OutputPlainText(IOutputStream& os, const TString& indent) const { +void TDynamicCounters::OutputPlainText(IOutputStream& os, const TString& indent) const { auto snap = ReadSnapshot(); // mark private records in plain text output auto outputVisibilityMarker = [] (EVisibility vis) { diff --git a/library/cpp/monlib/dynamic_counters/counters.h b/library/cpp/monlib/dynamic_counters/counters.h index 1f5fadd32d..dc178cfbe0 100644 --- a/library/cpp/monlib/dynamic_counters/counters.h +++ b/library/cpp/monlib/dynamic_counters/counters.h @@ -343,11 +343,11 @@ namespace NMonitoring { const TString& value, TIntrusivePtr<TDynamicCounters> subgroup); - void OutputHtml(IOutputStream& os) const; + void OutputHtml(IOutputStream& os) const; void EnumerateSubgroups(const std::function<void(const TString& name, const TString& value)>& output) const; // mostly for debugging purposes -- use accept with encoder instead - void OutputPlainText(IOutputStream& os, const TString& indent = "") const; + void OutputPlainText(IOutputStream& os, const TString& indent = "") const; void Accept( const TString& labelName, const TString& labelValue, diff --git a/library/cpp/monlib/dynamic_counters/counters_ut.cpp b/library/cpp/monlib/dynamic_counters/counters_ut.cpp index 8e79949be9..3591037e0a 100644 --- a/library/cpp/monlib/dynamic_counters/counters_ut.cpp +++ b/library/cpp/monlib/dynamic_counters/counters_ut.cpp @@ -6,7 +6,7 @@ using namespace NMonitoring; class TCountersPrinter: public ICountableConsumer { public: - TCountersPrinter(IOutputStream* out) + TCountersPrinter(IOutputStream* out) : Out_(out) , Level_(0) { @@ -41,7 +41,7 @@ private: Indent(Out_, --Level_) << "}\n"; } - static IOutputStream& Indent(IOutputStream* out, int level) { + static IOutputStream& Indent(IOutputStream* out, int level) { for (int i = 0; i < level; i++) { out->Write(" "); } @@ -49,12 +49,12 @@ private: } private: - IOutputStream* Out_; + IOutputStream* Out_; int Level_ = 0; }; -Y_UNIT_TEST_SUITE(TDynamicCountersTest) { - Y_UNIT_TEST(CountersConsumer) { +Y_UNIT_TEST_SUITE(TDynamicCountersTest) { + Y_UNIT_TEST(CountersConsumer) { TDynamicCounterPtr rootGroup(new TDynamicCounters()); auto usersCounter = rootGroup->GetNamedCounter("users", "count"); @@ -97,7 +97,7 @@ Y_UNIT_TEST_SUITE(TDynamicCountersTest) { "}\n"); } - Y_UNIT_TEST(MergeSubgroup) { + Y_UNIT_TEST(MergeSubgroup) { TDynamicCounterPtr rootGroup(new TDynamicCounters()); auto sensor1 = rootGroup->GetNamedCounter("sensor", "1"); @@ -127,7 +127,7 @@ Y_UNIT_TEST_SUITE(TDynamicCountersTest) { "}\n"); } - Y_UNIT_TEST(ResetCounters) { + Y_UNIT_TEST(ResetCounters) { TDynamicCounterPtr rootGroup(new TDynamicCounters()); auto sensor1 = rootGroup->GetNamedCounter("sensor", "1"); @@ -176,7 +176,7 @@ Y_UNIT_TEST_SUITE(TDynamicCountersTest) { "}\n"); } - Y_UNIT_TEST(RemoveCounter) { + Y_UNIT_TEST(RemoveCounter) { TDynamicCounterPtr rootGroup(new TDynamicCounters()); rootGroup->GetNamedCounter("label", "1"); @@ -202,7 +202,7 @@ Y_UNIT_TEST_SUITE(TDynamicCountersTest) { "}\n"); } - Y_UNIT_TEST(RemoveSubgroup) { + Y_UNIT_TEST(RemoveSubgroup) { TDynamicCounterPtr rootGroup(new TDynamicCounters()); rootGroup->GetSubgroup("group", "1"); diff --git a/library/cpp/monlib/dynamic_counters/encode_ut.cpp b/library/cpp/monlib/dynamic_counters/encode_ut.cpp index bc60b2a933..52d77b6b41 100644 --- a/library/cpp/monlib/dynamic_counters/encode_ut.cpp +++ b/library/cpp/monlib/dynamic_counters/encode_ut.cpp @@ -130,10 +130,10 @@ namespace NMonitoring { } } - Y_UNIT_TEST_SUITE(TDynamicCountersEncodeTest) { + Y_UNIT_TEST_SUITE(TDynamicCountersEncodeTest) { TTestData Data; - Y_UNIT_TEST(Json) { + Y_UNIT_TEST(Json) { TString result; { TStringOutput out(result); @@ -150,7 +150,7 @@ namespace NMonitoring { AssertResult(samples); } - Y_UNIT_TEST(Spack) { + Y_UNIT_TEST(Spack) { TBuffer result; { TBufferOutput out(result); diff --git a/library/cpp/monlib/dynamic_counters/golovan_page.cpp b/library/cpp/monlib/dynamic_counters/golovan_page.cpp index 0654519a7e..49cf2d39bb 100644 --- a/library/cpp/monlib/dynamic_counters/golovan_page.cpp +++ b/library/cpp/monlib/dynamic_counters/golovan_page.cpp @@ -59,7 +59,7 @@ public: } private: - IOutputStream& out; + IOutputStream& out; bool FirstCounter; TString prefix; }; diff --git a/library/cpp/monlib/encode/buffered/string_pool_ut.cpp b/library/cpp/monlib/encode/buffered/string_pool_ut.cpp index 1b360f5cdc..9fc3421d0b 100644 --- a/library/cpp/monlib/encode/buffered/string_pool_ut.cpp +++ b/library/cpp/monlib/encode/buffered/string_pool_ut.cpp @@ -4,8 +4,8 @@ using namespace NMonitoring; -Y_UNIT_TEST_SUITE(TStringPoolTest) { - Y_UNIT_TEST(PutIfAbsent) { +Y_UNIT_TEST_SUITE(TStringPoolTest) { + Y_UNIT_TEST(PutIfAbsent) { TStringPoolBuilder strPool; strPool.SetSorted(true); @@ -25,7 +25,7 @@ Y_UNIT_TEST_SUITE(TStringPoolTest) { UNIT_ASSERT_VALUES_EQUAL(strPool.Count(), 2); } - Y_UNIT_TEST(SortByFrequency) { + Y_UNIT_TEST(SortByFrequency) { TStringPoolBuilder strPool; strPool.SetSorted(true); @@ -47,7 +47,7 @@ Y_UNIT_TEST_SUITE(TStringPoolTest) { UNIT_ASSERT_VALUES_EQUAL(strPool.Count(), 2); } - Y_UNIT_TEST(ForEach) { + Y_UNIT_TEST(ForEach) { TStringPoolBuilder strPool; strPool.SetSorted(true); diff --git a/library/cpp/monlib/encode/format_ut.cpp b/library/cpp/monlib/encode/format_ut.cpp index 516d89cd3f..22a0e30c03 100644 --- a/library/cpp/monlib/encode/format_ut.cpp +++ b/library/cpp/monlib/encode/format_ut.cpp @@ -9,7 +9,7 @@ using namespace NMonitoring; -Y_UNIT_TEST_SUITE(TFormatTest) { +Y_UNIT_TEST_SUITE(TFormatTest) { Y_UNIT_TEST(ContentTypeHeader) { UNIT_ASSERT_EQUAL(FormatFromContentType(""), EFormat::UNKNOWN); UNIT_ASSERT_EQUAL(FormatFromContentType("application/json;some=stuff"), EFormat::JSON); @@ -18,7 +18,7 @@ Y_UNIT_TEST_SUITE(TFormatTest) { UNIT_ASSERT_EQUAL(FormatFromContentType(";application/xml"), EFormat::UNKNOWN); } - Y_UNIT_TEST(AcceptHeader) { + Y_UNIT_TEST(AcceptHeader) { UNIT_ASSERT_EQUAL(FormatFromAcceptHeader(""), EFormat::UNKNOWN); UNIT_ASSERT_EQUAL(FormatFromAcceptHeader("*/*"), EFormat::UNKNOWN); @@ -63,7 +63,7 @@ Y_UNIT_TEST_SUITE(TFormatTest) { EFormat::PROMETHEUS); } - Y_UNIT_TEST(FormatToStrFromStr) { + Y_UNIT_TEST(FormatToStrFromStr) { const std::array<EFormat, 6> formats = {{ EFormat::UNKNOWN, EFormat::SPACK, @@ -80,7 +80,7 @@ Y_UNIT_TEST_SUITE(TFormatTest) { } } - Y_UNIT_TEST(AcceptEncodingHeader) { + Y_UNIT_TEST(AcceptEncodingHeader) { UNIT_ASSERT_EQUAL( CompressionFromAcceptEncodingHeader(""), ECompression::UNKNOWN); @@ -118,7 +118,7 @@ Y_UNIT_TEST_SUITE(TFormatTest) { ECompression::LZ4); } - Y_UNIT_TEST(CompressionToStrFromStr) { + Y_UNIT_TEST(CompressionToStrFromStr) { const std::array<ECompression, 5> algs = {{ ECompression::UNKNOWN, ECompression::IDENTITY, diff --git a/library/cpp/monlib/encode/json/json_ut.cpp b/library/cpp/monlib/encode/json/json_ut.cpp index e76e6691f9..09e7909289 100644 --- a/library/cpp/monlib/encode/json/json_ut.cpp +++ b/library/cpp/monlib/encode/json/json_ut.cpp @@ -132,10 +132,10 @@ namespace { } // namespace -Y_UNIT_TEST_SUITE(TJsonTest) { +Y_UNIT_TEST_SUITE(TJsonTest) { const TInstant now = TInstant::ParseIso8601Deprecated("2017-11-05T01:02:03Z"); - Y_UNIT_TEST(Encode) { + Y_UNIT_TEST(Encode) { auto check = [](bool cloud, bool buffered, TStringBuf expectedResourceKey) { TString json; TStringOutput out(json); @@ -353,7 +353,7 @@ Y_UNIT_TEST_SUITE(TJsonTest) { AssertPointEqual(s.GetPoints(0), TInstant::Zero(), ui64(1)); } } - Y_UNIT_TEST(Decode1) { + Y_UNIT_TEST(Decode1) { NProto::TMultiSamplesList samples; { IMetricEncoderPtr e = EncoderProtobuf(&samples); diff --git a/library/cpp/monlib/encode/spack/spack_v1_ut.cpp b/library/cpp/monlib/encode/spack/spack_v1_ut.cpp index ca3843f7e4..fe778eb7e0 100644 --- a/library/cpp/monlib/encode/spack/spack_v1_ut.cpp +++ b/library/cpp/monlib/encode/spack/spack_v1_ut.cpp @@ -48,7 +48,7 @@ void AssertPointEqual(const NProto::TPoint& p, TInstant time, i64 value) { UNIT_ASSERT_VALUES_EQUAL(p.GetInt64(), value); } -Y_UNIT_TEST_SUITE(TSpackTest) { +Y_UNIT_TEST_SUITE(TSpackTest) { ui8 expectedHeader_v1_0[] = { 0x53, 0x50, // magic "SP" (fixed ui16) // minor, major @@ -261,7 +261,7 @@ Y_UNIT_TEST_SUITE(TSpackTest) { return MakeIntrusive<TSummaryDoubleSnapshot>(10.1, -0.45, 0.478, 0.3, 30u); } - Y_UNIT_TEST(Encode) { + Y_UNIT_TEST(Encode) { TBuffer buffer; TBufferOutput out(buffer); auto e = EncoderSpackV1( @@ -669,19 +669,19 @@ Y_UNIT_TEST_SUITE(TSpackTest) { } } - Y_UNIT_TEST(CompressionIdentity) { + Y_UNIT_TEST(CompressionIdentity) { TestCompression(ECompression::IDENTITY); } - Y_UNIT_TEST(CompressionZlib) { + Y_UNIT_TEST(CompressionZlib) { TestCompression(ECompression::ZLIB); } - Y_UNIT_TEST(CompressionZstd) { + Y_UNIT_TEST(CompressionZstd) { TestCompression(ECompression::ZSTD); } - Y_UNIT_TEST(CompressionLz4) { + Y_UNIT_TEST(CompressionLz4) { TestCompression(ECompression::LZ4); } diff --git a/library/cpp/monlib/encode/text/text_encoder_ut.cpp b/library/cpp/monlib/encode/text/text_encoder_ut.cpp index 3ae749dd51..554b6f5fa9 100644 --- a/library/cpp/monlib/encode/text/text_encoder_ut.cpp +++ b/library/cpp/monlib/encode/text/text_encoder_ut.cpp @@ -6,7 +6,7 @@ using namespace NMonitoring; -Y_UNIT_TEST_SUITE(TTextText) { +Y_UNIT_TEST_SUITE(TTextText) { template <typename TFunc> TString EncodeToString(bool humanReadableTs, TFunc fn) { TStringStream ss; @@ -15,7 +15,7 @@ Y_UNIT_TEST_SUITE(TTextText) { return ss.Str(); } - Y_UNIT_TEST(Empty) { + Y_UNIT_TEST(Empty) { auto result = EncodeToString(true, [](IMetricEncoder* e) { e->OnStreamBegin(); e->OnStreamEnd(); @@ -23,7 +23,7 @@ Y_UNIT_TEST_SUITE(TTextText) { UNIT_ASSERT_STRINGS_EQUAL(result, ""); } - Y_UNIT_TEST(CommonPart) { + Y_UNIT_TEST(CommonPart) { auto result = EncodeToString(true, [](IMetricEncoder* e) { e->OnStreamBegin(); e->OnCommonTime(TInstant::ParseIso8601Deprecated("2017-01-02T03:04:05.006Z")); @@ -41,7 +41,7 @@ Y_UNIT_TEST_SUITE(TTextText) { "common labels: {project='solomon', cluster='man', service='stockpile'}\n"); } - Y_UNIT_TEST(Gauges) { + Y_UNIT_TEST(Gauges) { auto result = EncodeToString(true, [](IMetricEncoder* e) { e->OnStreamBegin(); { // no values @@ -157,7 +157,7 @@ Y_UNIT_TEST_SUITE(TTextText) { " IGAUGE bytesRx{host='solomon-sas-01', dc='sas'} [(2017-12-02T12:00:00Z, 2), (2017-12-02T12:00:05Z, 4), (2017-12-02T12:00:10Z, 8)]\n"); } - Y_UNIT_TEST(Counters) { + Y_UNIT_TEST(Counters) { auto doEncode = [](IMetricEncoder* e) { e->OnStreamBegin(); { // no values diff --git a/library/cpp/monlib/metrics/labels_ut.cpp b/library/cpp/monlib/metrics/labels_ut.cpp index 960e326d86..f0e4f532ab 100644 --- a/library/cpp/monlib/metrics/labels_ut.cpp +++ b/library/cpp/monlib/metrics/labels_ut.cpp @@ -4,11 +4,11 @@ using namespace NMonitoring; -Y_UNIT_TEST_SUITE(TLabelsTest) { +Y_UNIT_TEST_SUITE(TLabelsTest) { TLabel pSolomon("project", "solomon"); TLabel pKikimr("project", "kikimr"); - Y_UNIT_TEST(Equals) { + Y_UNIT_TEST(Equals) { UNIT_ASSERT(pSolomon == TLabel("project", "solomon")); UNIT_ASSERT_STRINGS_EQUAL(pSolomon.Name(), "project"); @@ -17,12 +17,12 @@ Y_UNIT_TEST_SUITE(TLabelsTest) { UNIT_ASSERT(pSolomon != pKikimr); } - Y_UNIT_TEST(ToString) { + Y_UNIT_TEST(ToString) { UNIT_ASSERT_STRINGS_EQUAL(pSolomon.ToString(), "project=solomon"); UNIT_ASSERT_STRINGS_EQUAL(pKikimr.ToString(), "project=kikimr"); } - Y_UNIT_TEST(FromString) { + Y_UNIT_TEST(FromString) { auto pYql = TLabel::FromString("project=yql"); UNIT_ASSERT_EQUAL(pYql, TLabel("project", "yql")); @@ -54,7 +54,7 @@ Y_UNIT_TEST_SUITE(TLabelsTest) { "label value cannot be empty"); } - Y_UNIT_TEST(TryFromString) { + Y_UNIT_TEST(TryFromString) { TLabel pYql; UNIT_ASSERT(TLabel::TryFromString("project=yql", pYql)); UNIT_ASSERT_EQUAL(pYql, TLabel("project", "yql")); @@ -91,7 +91,7 @@ Y_UNIT_TEST_SUITE(TLabelsTest) { } } - Y_UNIT_TEST(Labels) { + Y_UNIT_TEST(Labels) { TLabels labels; UNIT_ASSERT(labels.Add(TStringBuf("name1"), TStringBuf("value1"))); UNIT_ASSERT(labels.Size() == 1); @@ -135,7 +135,7 @@ Y_UNIT_TEST_SUITE(TLabelsTest) { })); } - Y_UNIT_TEST(Hash) { + Y_UNIT_TEST(Hash) { TLabel label("name", "value"); UNIT_ASSERT_EQUAL(ULL(2378153472115172159), label.Hash()); diff --git a/library/cpp/monlib/metrics/metric_registry_ut.cpp b/library/cpp/monlib/metrics/metric_registry_ut.cpp index 8d030386ad..86d9a52ec0 100644 --- a/library/cpp/monlib/metrics/metric_registry_ut.cpp +++ b/library/cpp/monlib/metrics/metric_registry_ut.cpp @@ -38,7 +38,7 @@ void Out<NMonitoring::NProto::TSingleSample::ValueCase>(IOutputStream& os, NMoni } Y_UNIT_TEST_SUITE(TMetricRegistryTest) { - Y_UNIT_TEST(Gauge) { + Y_UNIT_TEST(Gauge) { TMetricRegistry registry(TLabels{{"common", "label"}}); TGauge* g = registry.Gauge({{"my", "gauge"}}); @@ -122,7 +122,7 @@ Y_UNIT_TEST_SUITE(TMetricRegistryTest) { UNIT_ASSERT_VALUES_EQUAL(g->Get(), val); } - Y_UNIT_TEST(Counter) { + Y_UNIT_TEST(Counter) { TMetricRegistry registry(TLabels{{"common", "label"}}); TCounter* c = registry.Counter({{"my", "counter"}}); @@ -155,7 +155,7 @@ Y_UNIT_TEST_SUITE(TMetricRegistryTest) { UNIT_ASSERT_VALUES_EQUAL(r->Get(), 42); } - Y_UNIT_TEST(DoubleCounter) { + Y_UNIT_TEST(DoubleCounter) { TMetricRegistry registry(TLabels{{"common", "label"}}); TCounter* c = registry.Counter({{"my", "counter"}}); @@ -166,7 +166,7 @@ Y_UNIT_TEST_SUITE(TMetricRegistryTest) { UNIT_ASSERT_VALUES_EQUAL(c->Get(), 10); } - Y_UNIT_TEST(Sample) { + Y_UNIT_TEST(Sample) { TMetricRegistry registry(TLabels{{"common", "label"}}); TGauge* g = registry.Gauge({{"my", "gauge"}}); diff --git a/library/cpp/monlib/service/mon_service_http_request.h b/library/cpp/monlib/service/mon_service_http_request.h index 26cf39a5e5..b4f2f8f0c5 100644 --- a/library/cpp/monlib/service/mon_service_http_request.h +++ b/library/cpp/monlib/service/mon_service_http_request.h @@ -42,7 +42,7 @@ namespace NMonitoring { TMonService2HttpRequest* const Parent; TMonService2HttpRequest( - IOutputStream* out, const IHttpRequest* httpRequest, + IOutputStream* out, const IHttpRequest* httpRequest, TMonService2* monService, IMonPage* monPage, const TString& pathInfo, TMonService2HttpRequest* parent) diff --git a/library/cpp/monlib/service/monservice.cpp b/library/cpp/monlib/service/monservice.cpp index 25d8922672..d1b9cda1d2 100644 --- a/library/cpp/monlib/service/monservice.cpp +++ b/library/cpp/monlib/service/monservice.cpp @@ -23,7 +23,7 @@ TMonService2::TMonService2(const THttpServerOptions& options, const TString& tit , IndexMonPage(new TIndexMonPage("", Title)) , AuthProvider_{std::move(auth)} { - Y_VERIFY(!!title); + Y_VERIFY(!!title); time_t t = time(nullptr); ctime_r(&t, StartTime); } @@ -79,7 +79,7 @@ void TMonService2::OutputIndexBody(IOutputStream& out) { void TMonService2::ServeRequest(IOutputStream& out, const NMonitoring::IHttpRequest& request) { TString path = request.GetPath(); - Y_VERIFY(path.StartsWith('/')); + Y_VERIFY(path.StartsWith('/')); if (AuthProvider_) { const auto authResult = AuthProvider_->Check(request); diff --git a/library/cpp/monlib/service/pages/index_mon_page.cpp b/library/cpp/monlib/service/pages/index_mon_page.cpp index 1d6227ff03..83ff8b529a 100644 --- a/library/cpp/monlib/service/pages/index_mon_page.cpp +++ b/library/cpp/monlib/service/pages/index_mon_page.cpp @@ -53,8 +53,8 @@ void TIndexMonPage::Output(IMonHttpRequest& request) { void TIndexMonPage::OutputIndex(IOutputStream& out, bool pathEndsWithSlash) { TGuard<TMutex> g(Mtx); - for (auto& Page : Pages) { - IMonPage* page = Page.Get(); + for (auto& Page : Pages) { + IMonPage* page = Page.Get(); if (page->IsInIndex()) { TString pathToDir = ""; if (!pathEndsWithSlash) { @@ -97,7 +97,7 @@ TIndexMonPage* TIndexMonPage::RegisterIndexPage(const TString& path, const TStri IMonPage* TIndexMonPage::FindPage(const TString& relativePath) { TGuard<TMutex> g(Mtx); - Y_VERIFY(!relativePath.StartsWith('/')); + Y_VERIFY(!relativePath.StartsWith('/')); TPagesByPath::iterator i = PagesByPath.find("/" + relativePath); if (i == PagesByPath.end()) { return nullptr; @@ -110,7 +110,7 @@ TIndexMonPage* TIndexMonPage::FindIndexPage(const TString& relativePath) { return VerifyDynamicCast<TIndexMonPage*>(FindPage(relativePath)); } -void TIndexMonPage::OutputCommonJsCss(IOutputStream& out) { +void TIndexMonPage::OutputCommonJsCss(IOutputStream& out) { out << "<link rel='stylesheet' href='https://yastatic.net/bootstrap/3.3.1/css/bootstrap.min.css'>\n"; out << "<script language='javascript' type='text/javascript' src='https://yastatic.net/jquery/2.1.3/jquery.min.js'></script>\n"; out << "<script language='javascript' type='text/javascript' src='https://yastatic.net/bootstrap/3.3.1/js/bootstrap.min.js'></script>\n"; diff --git a/library/cpp/monlib/service/pages/mon_page.cpp b/library/cpp/monlib/service/pages/mon_page.cpp index 4d53beff06..72033b1699 100644 --- a/library/cpp/monlib/service/pages/mon_page.cpp +++ b/library/cpp/monlib/service/pages/mon_page.cpp @@ -6,8 +6,8 @@ IMonPage::IMonPage(const TString& path, const TString& title) : Path(path) , Title(title) { - Y_VERIFY(!Path.StartsWith('/')); - Y_VERIFY(!Path.EndsWith('/')); + Y_VERIFY(!Path.StartsWith('/')); + Y_VERIFY(!Path.EndsWith('/')); } void IMonPage::OutputNavBar(IOutputStream& out) { diff --git a/library/cpp/monlib/service/pages/templates.h b/library/cpp/monlib/service/pages/templates.h index ca98447ac5..b4656f059f 100644 --- a/library/cpp/monlib/service/pages/templates.h +++ b/library/cpp/monlib/service/pages/templates.h @@ -188,12 +188,12 @@ namespace NMonitoring { }; struct TOutputStreamRef { - TOutputStreamRef(IOutputStream& str) + TOutputStreamRef(IOutputStream& str) : Str(str) { } - inline operator IOutputStream&() noexcept { + inline operator IOutputStream&() noexcept { return Str; } @@ -201,7 +201,7 @@ namespace NMonitoring { return true; // just to work with WITH_SCOPED } - IOutputStream& Str; + IOutputStream& Str; }; extern const char HtmlTag[5]; diff --git a/library/cpp/monlib/service/service.cpp b/library/cpp/monlib/service/service.cpp index e486b15dd4..929efbf816 100644 --- a/library/cpp/monlib/service/service.cpp +++ b/library/cpp/monlib/service/service.cpp @@ -8,7 +8,7 @@ #include <util/generic/buffer.h> #include <util/stream/str.h> -#include <util/stream/buffer.h> +#include <util/stream/buffer.h> #include <util/stream/zerocopy.h> #include <util/string/vector.h> @@ -30,7 +30,7 @@ namespace NMonitoring { return; } TString path = GetPath(); - if (!path.StartsWith('/')) { + if (!path.StartsWith('/')) { out << "HTTP/1.1 400 Bad request\r\nConnection: Close\r\n\r\n"; return; } @@ -165,7 +165,7 @@ namespace NMonitoring { throw; // just rethrow } - void TCoHttpServer::ProcessRequest(IOutputStream& out, const IHttpRequest& request) { + void TCoHttpServer::ProcessRequest(IOutputStream& out, const IHttpRequest& request) { try { TNetworkAddress addr(BindAddr, Port); TSocket sock(addr); @@ -257,7 +257,7 @@ namespace NMonitoring { CoServer.Stop(); } - void TMonService::DispatchRequest(IOutputStream& out, const IHttpRequest& request) { + void TMonService::DispatchRequest(IOutputStream& out, const IHttpRequest& request) { if (strcmp(request.GetPath(), "/") == 0) { out << "HTTP/1.1 200 Ok\nConnection: Close\n\n"; MtHandler(out, request); diff --git a/library/cpp/monlib/service/service.h b/library/cpp/monlib/service/service.h index 6aa112902e..2f66dddaf8 100644 --- a/library/cpp/monlib/service/service.h +++ b/library/cpp/monlib/service/service.h @@ -41,7 +41,7 @@ namespace NMonitoring { // by forwarding it to the httpserver // @note this call may be blocking; don't use inside coroutines // @throws may throw in case of connection error, etc - void ProcessRequest(IOutputStream&, const IHttpRequest&); + void ProcessRequest(IOutputStream&, const IHttpRequest&); private: class TConnection; @@ -101,7 +101,7 @@ namespace NMonitoring { void Stop(); protected: - void DispatchRequest(IOutputStream& out, const IHttpRequest&); + void DispatchRequest(IOutputStream& out, const IHttpRequest&); private: TCoHttpServer CoServer; |