From 1b940367d137b6e01f0beab66fa5d3975bca2d40 Mon Sep 17 00:00:00 2001 From: Pisarenko Grigoriy <79596613+GrigoriyPA@users.noreply.github.com> Date: Fri, 14 Jun 2024 15:18:04 +0300 Subject: [PATCH] KqpRun fixed performance and backtrace printing (#5368) --- ydb/core/testlib/actors/test_runtime.cpp | 2 +- ydb/core/testlib/test_client.cpp | 2 +- ydb/core/testlib/test_client.h | 2 ++ ydb/library/actors/testlib/test_runtime.cpp | 3 ++- ydb/library/actors/testlib/test_runtime.h | 3 ++- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ydb/core/testlib/actors/test_runtime.cpp b/ydb/core/testlib/actors/test_runtime.cpp index 1c77949d6b99..0d177ed18f09 100644 --- a/ydb/core/testlib/actors/test_runtime.cpp +++ b/ydb/core/testlib/actors/test_runtime.cpp @@ -168,7 +168,7 @@ namespace NActors { } if (NeedMonitoring && !SingleSysEnv) { - ui16 port = GetPortManager().GetPort(); + ui16 port = MonitoringPortOffset ? MonitoringPortOffset + nodeIndex : GetPortManager().GetPort(); node->Mon.Reset(new NActors::TSyncHttpMon({ .Port = port, .Threads = 10, diff --git a/ydb/core/testlib/test_client.cpp b/ydb/core/testlib/test_client.cpp index 9cb347017589..1c780bc7c3b1 100644 --- a/ydb/core/testlib/test_client.cpp +++ b/ydb/core/testlib/test_client.cpp @@ -230,7 +230,7 @@ namespace Tests { NKikimr::SetupChannelProfiles(app, Settings->Domain); - Runtime->SetupMonitoring(); + Runtime->SetupMonitoring(Settings->MonitoringPortOffset); Runtime->SetLogBackend(Settings->LogBackend); Runtime->AddAppDataInit([this](ui32 nodeIdx, NKikimr::TAppData& appData) { diff --git a/ydb/core/testlib/test_client.h b/ydb/core/testlib/test_client.h index cc8feb752abb..2c202c75e0bc 100644 --- a/ydb/core/testlib/test_client.h +++ b/ydb/core/testlib/test_client.h @@ -97,6 +97,7 @@ namespace Tests { ui16 Port; ui16 GrpcPort = 0; int GrpcMaxMessageSize = 0; // 0 - default (4_MB), -1 - no limit + ui16 MonitoringPortOffset = 0; NKikimrProto::TAuthConfig AuthConfig; NKikimrPQ::TPQConfig PQConfig; NKikimrPQ::TPQClusterDiscoveryConfig PQClusterDiscoveryConfig; @@ -147,6 +148,7 @@ namespace Tests { TServerSettings& SetGrpcPort(ui16 value) { GrpcPort = value; return *this; } TServerSettings& SetGrpcMaxMessageSize(int value) { GrpcMaxMessageSize = value; return *this; } + TServerSettings& SetMonitoringPortOffset(ui16 value) { MonitoringPortOffset = value; return *this; } TServerSettings& SetSupportsRedirect(bool value) { SupportsRedirect = value; return *this; } TServerSettings& SetTracePath(const TString& value) { TracePath = value; return *this; } TServerSettings& SetDomain(ui32 value) { Domain = value; return *this; } diff --git a/ydb/library/actors/testlib/test_runtime.cpp b/ydb/library/actors/testlib/test_runtime.cpp index 7e59e45b8880..a8813d97a7cc 100644 --- a/ydb/library/actors/testlib/test_runtime.cpp +++ b/ydb/library/actors/testlib/test_runtime.cpp @@ -1592,8 +1592,9 @@ namespace NActors { return node->DynamicCounters; } - void TTestActorRuntimeBase::SetupMonitoring() { + void TTestActorRuntimeBase::SetupMonitoring(ui16 monitoringPortOffset) { NeedMonitoring = true; + MonitoringPortOffset = monitoringPortOffset; } void TTestActorRuntimeBase::SendInternal(TAutoPtr ev, ui32 nodeIndex, bool viaActorSystem) { diff --git a/ydb/library/actors/testlib/test_runtime.h b/ydb/library/actors/testlib/test_runtime.h index d6b20ca9a357..eef097c1b7b9 100644 --- a/ydb/library/actors/testlib/test_runtime.h +++ b/ydb/library/actors/testlib/test_runtime.h @@ -295,7 +295,7 @@ namespace NActors { void EnableScheduleForActor(const TActorId& actorId, bool allow = true); bool IsScheduleForActorEnabled(const TActorId& actorId) const; TIntrusivePtr GetDynamicCounters(ui32 nodeIndex = 0); - void SetupMonitoring(); + void SetupMonitoring(ui16 monitoringPortOffset = 0); using TEventObserverCollection = std::list& event)>>; class TEventObserverHolder { @@ -655,6 +655,7 @@ namespace NActors { TIntrusivePtr DispatcherRandomProvider; TAutoPtr LogBackend; bool NeedMonitoring; + ui16 MonitoringPortOffset = 0; TIntrusivePtr RandomProvider; TIntrusivePtr TimeProvider;