aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/monlib
diff options
context:
space:
mode:
authorilnurkh <ilnurkh@yandex-team.com>2023-10-09 23:39:40 +0300
committerilnurkh <ilnurkh@yandex-team.com>2023-10-09 23:57:14 +0300
commite601ca03f859335d57ecff2e5aa6af234b6052ed (patch)
treede519a847e58a1b3993fcbfe05ff44cc946a3e24 /library/cpp/monlib
parentbbf2b6878af3854815a2c0ecb07a687071787639 (diff)
downloadydb-e601ca03f859335d57ecff2e5aa6af234b6052ed.tar.gz
Y_VERIFY->Y_ABORT_UNLESS at ^l
https://clubs.at.yandex-team.ru/arcadia/29404
Diffstat (limited to 'library/cpp/monlib')
-rw-r--r--library/cpp/monlib/dynamic_counters/contention_ut.cpp2
-rw-r--r--library/cpp/monlib/dynamic_counters/counters.cpp12
-rw-r--r--library/cpp/monlib/metrics/ewma.cpp2
-rw-r--r--library/cpp/monlib/service/monservice.cpp6
-rw-r--r--library/cpp/monlib/service/pages/index_mon_page.cpp6
-rw-r--r--library/cpp/monlib/service/pages/mon_page.cpp4
6 files changed, 16 insertions, 16 deletions
diff --git a/library/cpp/monlib/dynamic_counters/contention_ut.cpp b/library/cpp/monlib/dynamic_counters/contention_ut.cpp
index 8798044ee3c..166b3452501 100644
--- a/library/cpp/monlib/dynamic_counters/contention_ut.cpp
+++ b/library/cpp/monlib/dynamic_counters/contention_ut.cpp
@@ -47,7 +47,7 @@ Y_UNIT_TEST_SUITE(TDynamicCountersContentionTest) {
// acts like a coroutine
Ev.Wait();
auto ctr = Counters->GetSubgroup("label", "value")->GetCounter("name");
- Y_VERIFY(*ctr == 42);
+ Y_ABORT_UNLESS(*ctr == 42);
Response.Signal();
}
};
diff --git a/library/cpp/monlib/dynamic_counters/counters.cpp b/library/cpp/monlib/dynamic_counters/counters.cpp
index 8cc6f6e8351..09455be2d78 100644
--- a/library/cpp/monlib/dynamic_counters/counters.cpp
+++ b/library/cpp/monlib/dynamic_counters/counters.cpp
@@ -121,7 +121,7 @@ void TDynamicCounters::RemoveSubgroupChain(const std::vector<std::pair<TString,
const auto& [name, value] = chain[i];
auto& base = basePointers.back();
basePointers.push_back(base->GetSubgroup(name, value));
- Y_VERIFY(basePointers.back());
+ Y_ABORT_UNLESS(basePointers.back());
}
for (size_t i = chain.size(); i-- && basePointers[i]->RemoveSubgroup(chain[i].first, chain[i].second); ) {}
}
@@ -158,16 +158,16 @@ bool TDynamicCounters::RemoveSubgroup(const TString& name, const TString& value)
void TDynamicCounters::ReplaceSubgroup(const TString& name, const TString& value, TIntrusivePtr<TDynamicCounters> subgroup) {
auto g = LockForUpdate("ReplaceSubgroup", name, value);
const auto it = Counters.find({name, value});
- Y_VERIFY(it != Counters.end() && AsDynamicCounters(it->second));
+ Y_ABORT_UNLESS(it != Counters.end() && AsDynamicCounters(it->second));
it->second = std::move(subgroup);
}
void TDynamicCounters::MergeWithSubgroup(const TString& name, const TString& value) {
auto g = LockForUpdate("MergeWithSubgroup", name, value);
auto it = Counters.find({name, value});
- Y_VERIFY(it != Counters.end());
+ Y_ABORT_UNLESS(it != Counters.end());
TIntrusivePtr<TDynamicCounters> subgroup = AsDynamicCounters(it->second);
- Y_VERIFY(subgroup);
+ Y_ABORT_UNLESS(subgroup);
Counters.erase(it);
Counters.merge(subgroup->Resign());
AtomicAdd(ExpiringCount, AtomicSwap(&subgroup->ExpiringCount, 0));
@@ -187,10 +187,10 @@ void TDynamicCounters::ResetCounters(bool derivOnly) {
}
void TDynamicCounters::RegisterCountable(const TString& name, const TString& value, TCountablePtr countable) {
- Y_VERIFY(countable);
+ Y_ABORT_UNLESS(countable);
auto g = LockForUpdate("RegisterCountable", name, value);
const bool inserted = Counters.emplace(TChildId(name, value), std::move(countable)).second;
- Y_VERIFY(inserted);
+ Y_ABORT_UNLESS(inserted);
}
void TDynamicCounters::RegisterSubgroup(const TString& name, const TString& value, TIntrusivePtr<TDynamicCounters> subgroup) {
diff --git a/library/cpp/monlib/metrics/ewma.cpp b/library/cpp/monlib/metrics/ewma.cpp
index 8a296c32258..e8ed49131b3 100644
--- a/library/cpp/monlib/metrics/ewma.cpp
+++ b/library/cpp/monlib/metrics/ewma.cpp
@@ -19,7 +19,7 @@ namespace {
, Alpha_{alpha}
, Interval_{interval.Seconds()}
{
- Y_VERIFY(metric != nullptr, "Passing nullptr metric is not allowed");
+ Y_ABORT_UNLESS(metric != nullptr, "Passing nullptr metric is not allowed");
}
~TExpMovingAverage() override = default;
diff --git a/library/cpp/monlib/service/monservice.cpp b/library/cpp/monlib/service/monservice.cpp
index d1b9cda1d21..45986a62d25 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_ABORT_UNLESS(!!title);
time_t t = time(nullptr);
ctime_r(&t, StartTime);
}
@@ -34,7 +34,7 @@ TMonService2::TMonService2(const THttpServerOptions& options, TSimpleSharedPtr<I
, IndexMonPage(new TIndexMonPage("", Title))
, AuthProvider_{std::move(auth)}
{
- Y_VERIFY(!!title);
+ Y_ABORT_UNLESS(!!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_ABORT_UNLESS(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 c9b2f82cc02..87cc1491468 100644
--- a/library/cpp/monlib/service/pages/index_mon_page.cpp
+++ b/library/cpp/monlib/service/pages/index_mon_page.cpp
@@ -20,7 +20,7 @@ void TIndexMonPage::Output(IMonHttpRequest& request) {
return;
}
- Y_VERIFY(pathInfo.StartsWith('/'));
+ Y_ABORT_UNLESS(pathInfo.StartsWith('/'));
TMonPagePtr found;
// analogous to CGI PATH_INFO
@@ -31,11 +31,11 @@ void TIndexMonPage::Output(IMonHttpRequest& request) {
if (TPagesByPath::iterator i = PagesByPath.find(pathTmp); i != PagesByPath.end()) {
found = *i->second;
pathInfo = request.GetPathInfo().substr(pathTmp.size());
- Y_VERIFY(pathInfo.empty() || pathInfo.StartsWith('/'));
+ Y_ABORT_UNLESS(pathInfo.empty() || pathInfo.StartsWith('/'));
break;
}
size_t slash = pathTmp.find_last_of('/');
- Y_VERIFY(slash != TString::npos);
+ Y_ABORT_UNLESS(slash != TString::npos);
pathTmp = pathTmp.substr(0, slash);
if (!pathTmp) {
break;
diff --git a/library/cpp/monlib/service/pages/mon_page.cpp b/library/cpp/monlib/service/pages/mon_page.cpp
index 72033b1699a..929c54b084c 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_ABORT_UNLESS(!Path.StartsWith('/'));
+ Y_ABORT_UNLESS(!Path.EndsWith('/'));
}
void IMonPage::OutputNavBar(IOutputStream& out) {