Skip to content

Commit

Permalink
get rid of sync http mon (#12637)
Browse files Browse the repository at this point in the history
  • Loading branch information
adameat authored Dec 17, 2024
1 parent 426ac15 commit e1f89b0
Show file tree
Hide file tree
Showing 17 changed files with 1,046 additions and 1,236 deletions.
10 changes: 7 additions & 3 deletions ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_run.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "blobstorage_pdisk_ut_base_test.h"

#include <ydb/core/base/appdata.h>
#include <ydb/core/mon/sync_http_mon.h>
#include <ydb/core/mon/mon.h>
#include <ydb/core/blobstorage/crypto/default.h>
#include <ydb/library/pdisk_io/aio.h>
#include <ydb/core/util/random.h>
Expand Down Expand Up @@ -142,17 +142,21 @@ void Run(TVector<IActor*> tests, TTestRunConfig runCfg) {

if (IsMonitoringEnabled) {
// Monitoring startup
monitoring.Reset(new NActors::TSyncHttpMon({
monitoring.Reset(new NActors::TMon({
.Port = pm.GetPort(8081),
.Title = "TestYard monitoring"
}));
appData.Mon = monitoring.Get();

monitoring->RegisterCountersPage("counters", "Counters", mainCounters);
monitoring->Start();
}

actorSystem1->Start();

if (IsMonitoringEnabled) {
monitoring->Start(actorSystem1.Get());
}

Sleep(TDuration::MilliSeconds(runCfg.BeforeTestSleepMs));

VERBOSE_COUT("Sending TEvBoot to test");
Expand Down
18 changes: 8 additions & 10 deletions ydb/core/blobstorage/ut_vdisk/lib/astest.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <ydb/library/actors/core/executor_pool_basic.h>
#include <ydb/library/actors/core/executor_pool_io.h>
#include <ydb/library/actors/core/scheduler_basic.h>
#include <ydb/core/mon/sync_http_mon.h>
#include <ydb/core/mon/mon.h>
#include <ydb/library/actors/interconnect/interconnect.h>
#include <ydb/library/actors/protos/services_common.pb.h>
#include <ydb/core/base/appdata.h>
Expand Down Expand Up @@ -82,6 +82,7 @@ inline void TTestWithActorSystem::Run(NActors::IActor *testActor) {
NKikimrServices::EServiceKikimr_Name
);
TString explanation;
logSettings->SetLevel(NLog::PRI_TRACE, NActorsServices::EServiceCommon::HTTP, explanation);
//logSettings->SetLevel(NLog::PRI_INFO, NKikimrServices::BS_SKELETON, explanation);
//logSettings->SetLevel(NLog::PRI_INFO, NKikimrServices::BS_HULLCOMP, explan
NActors::TLoggerActor *loggerActor = new NActors::TLoggerActor(logSettings,
Expand All @@ -92,12 +93,6 @@ inline void TTestWithActorSystem::Run(NActors::IActor *testActor) {
setup1->LocalServices.push_back(std::move(loggerActorPair));
//////////////////////////////////////////////////////////////////////////////

///////////////////////// SETUP TEST ACTOR ///////////////////////////////////
NActors::TActorId testActorId = NActors::TActorId(1, "test123");
TActorSetupCmd testActorSetup(testActor, TMailboxType::Simple, 0);
setup1->LocalServices.push_back(std::pair<TActorId, TActorSetupCmd>(testActorId, std::move(testActorSetup)));
//////////////////////////////////////////////////////////////////////////////

///////////////////////// TYPE REGISTRY //////////////////////////////////////
TIntrusivePtr<NKikimr::NScheme::TTypeRegistry> typeRegistry(new NKikimr::NScheme::TKikimrTypeRegistry());
//////////////////////////////////////////////////////////////////////////////
Expand All @@ -106,14 +101,13 @@ inline void TTestWithActorSystem::Run(NActors::IActor *testActor) {
if (!MonPort) {
MonPort = pm.GetPort(MonPort);
}
Monitoring.reset(new NActors::TSyncHttpMon({
Monitoring.reset(new NActors::TMon({
.Port = MonPort,
.Title = "at"
}));
NMonitoring::TIndexMonPage *actorsMonPage = Monitoring->RegisterIndexPage("actors", "Actors");
Y_UNUSED(actorsMonPage);
Monitoring->RegisterCountersPage("counters", "Counters", Counters);
Monitoring->Start();
loggerActor->Log(Now(), NKikimr::NLog::PRI_NOTICE, NActorsServices::TEST, "Monitoring settings set up");
//////////////////////////////////////////////////////////////////////////////

Expand All @@ -126,11 +120,15 @@ inline void TTestWithActorSystem::Run(NActors::IActor *testActor) {
ActorSystem1.reset(new TActorSystem(setup1, AppData.get(), logSettings));
loggerActor->Log(Now(), NKikimr::NLog::PRI_NOTICE, NActorsServices::TEST, "Actor system created");


ActorSystem1->Start();
LOG_NOTICE(*ActorSystem1, NActorsServices::TEST, "Actor system started");

Monitoring->Start(ActorSystem1.get()).wait();

///////////////////////// SETUP TEST ACTOR ///////////////////////////////////
NActors::TActorId testActorId = NActors::TActorId(1, "test123");
ActorSystem1->RegisterLocalService(testActorId, ActorSystem1->Register(testActor, TMailboxType::Simple, 0));
//////////////////////////////////////////////////////////////////////////////

DoneEvent.Wait();
ActorSystem1->Stop();
Expand Down
6 changes: 3 additions & 3 deletions ydb/core/blobstorage/ut_vdisk/lib/prepare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <ydb/core/blobstorage/pdisk/blobstorage_pdisk.h>
#include <ydb/core/blobstorage/pdisk/blobstorage_pdisk_tools.h>

#include <ydb/core/mon/sync_http_mon.h>
#include <ydb/core/mon/mon.h>
#include <ydb/core/scheme/scheme_type_registry.h>

#include <ydb/library/actors/core/executor_pool_basic.h>
Expand Down Expand Up @@ -368,13 +368,12 @@ void TConfiguration::Prepare(IVDiskSetup *vdiskSetup, bool newPDisks, bool runRe
//////////////////////////////////////////////////////////////////////////////

///////////////////////// MONITORING SETTINGS /////////////////////////////////
Monitoring.reset(new NActors::TSyncHttpMon({
Monitoring.reset(new NActors::TMon({
.Port = 8088,
.Title = "at"
}));
NMonitoring::TIndexMonPage *actorsMonPage = Monitoring->RegisterIndexPage("actors", "Actors");
Monitoring->RegisterCountersPage("counters", "Counters", Counters);
Monitoring->Start();
loggerActor->Log(Now(), NKikimr::NLog::PRI_NOTICE, NActorsServices::TEST, "Monitoring settings set up");
//////////////////////////////////////////////////////////////////////////////

Expand All @@ -391,6 +390,7 @@ void TConfiguration::Prepare(IVDiskSetup *vdiskSetup, bool newPDisks, bool runRe
loggerActor->Log(Now(), NKikimr::NLog::PRI_NOTICE, NActorsServices::TEST, "Actor system created");

ActorSystem1->Start();
Monitoring->Start(ActorSystem1.get());
LOG_NOTICE(*ActorSystem1, NActorsServices::TEST, "Actor system started");

}
Expand Down
13 changes: 4 additions & 9 deletions ydb/core/driver_lib/run/run.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
#include <ydb/core/grpc_services/grpc_request_proxy.h>
#include <ydb/core/grpc_services/grpc_mon.h>
#include <ydb/core/log_backend/log_backend.h>
#include <ydb/core/mon/sync_http_mon.h>
#include <ydb/core/mon/async_http_mon.h>
#include <ydb/core/mon/mon.h>
#include <ydb/core/mon/crossref.h>
#include <ydb/core/mon_alloc/profiler.h>

Expand Down Expand Up @@ -473,11 +472,7 @@ void TKikimrRunner::InitializeMonitoring(const TKikimrRunConfig& runConfig, bool
if (ModuleFactories && ModuleFactories->MonitoringFactory) {
Monitoring = ModuleFactories->MonitoringFactory(std::move(monConfig), appConfig);
} else {
if (appConfig.GetFeatureFlags().GetEnableAsyncHttpMon()) {
Monitoring = new NActors::TAsyncHttpMon(std::move(monConfig));
} else {
Monitoring = new NActors::TSyncHttpMon(std::move(monConfig));
}
Monitoring = new NActors::TMon(std::move(monConfig));
}
if (Monitoring) {
Monitoring->RegisterCountersPage("counters", "Counters", Counters);
Expand Down Expand Up @@ -1783,10 +1778,10 @@ void TKikimrRunner::KikimrStop(bool graceful) {
if (enableReleaseNodeNameOnGracefulShutdown) {
using namespace NKikimr::NNodeBroker;
using TEvent = TEvNodeBroker::TEvGracefulShutdownRequest;

const ui32 nodeId = ActorSystem->NodeId;
bool isDynamicNode = AppData->DynamicNameserviceConfig->MinDynamicNodeId <= nodeId;

if (isDynamicNode) {
NTabletPipe::TClientConfig pipeConfig;
pipeConfig.RetryPolicy = {.RetryLimitCount = 10};
Expand Down
6 changes: 3 additions & 3 deletions ydb/core/http_proxy/ut/datastreams_fixture.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <ydb/core/http_proxy/http_req.h>
#include <ydb/core/http_proxy/http_service.h>
#include <ydb/core/http_proxy/metrics_actor.h>
#include <ydb/core/mon/sync_http_mon.h>
#include <ydb/core/mon/mon.h>
#include <ydb/core/ymq/actor/auth_multi_factory.h>

#include <ydb/library/aclib/aclib.h>
Expand Down Expand Up @@ -839,15 +839,15 @@ class THttpProxyTestMock : public NUnitTest::TBaseFixture {
MonPort = TPortManager().GetPort();
Counters = new NMonitoring::TDynamicCounters();

Monitoring.Reset(new NActors::TSyncHttpMon({
Monitoring.Reset(new NActors::TMon({
.Port = MonPort,
.Address = "127.0.0.1",
.Threads = 3,
.Title = "whatever",
.Host = "127.0.0.1",
}));
Monitoring->RegisterCountersPage("counters", "Counters", Counters);
Monitoring->Start();
Monitoring->Start(ActorRuntime->GetAnyNodeActorSystem());

Sleep(TDuration::Seconds(1));

Expand Down
Loading

0 comments on commit e1f89b0

Please sign in to comment.