Skip to content

Commit

Permalink
KqpRun fixed performance and backtrace printing (ydb-platform#5368)
Browse files Browse the repository at this point in the history
  • Loading branch information
GrigoriyPA authored and UgnineSirdis committed Jul 8, 2024
1 parent 2d40f8a commit 1b94036
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ydb/core/testlib/actors/test_runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion ydb/core/testlib/test_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions ydb/core/testlib/test_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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; }
Expand Down
3 changes: 2 additions & 1 deletion ydb/library/actors/testlib/test_runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<IEventHandle> ev, ui32 nodeIndex, bool viaActorSystem) {
Expand Down
3 changes: 2 additions & 1 deletion ydb/library/actors/testlib/test_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ namespace NActors {
void EnableScheduleForActor(const TActorId& actorId, bool allow = true);
bool IsScheduleForActorEnabled(const TActorId& actorId) const;
TIntrusivePtr<NMonitoring::TDynamicCounters> GetDynamicCounters(ui32 nodeIndex = 0);
void SetupMonitoring();
void SetupMonitoring(ui16 monitoringPortOffset = 0);

using TEventObserverCollection = std::list<std::function<void(TAutoPtr<IEventHandle>& event)>>;
class TEventObserverHolder {
Expand Down Expand Up @@ -655,6 +655,7 @@ namespace NActors {
TIntrusivePtr<IRandomProvider> DispatcherRandomProvider;
TAutoPtr<TLogBackend> LogBackend;
bool NeedMonitoring;
ui16 MonitoringPortOffset = 0;

TIntrusivePtr<IRandomProvider> RandomProvider;
TIntrusivePtr<ITimeProvider> TimeProvider;
Expand Down

0 comments on commit 1b94036

Please sign in to comment.