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 naspirato committed Jun 18, 2024
1 parent d17747f commit 418fff2
Show file tree
Hide file tree
Showing 14 changed files with 637 additions and 350 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 @@ -174,7 +174,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 @@ -225,7 +225,7 @@ namespace Tests {

NKikimr::SetupChannelProfiles(app);

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 @@ -106,6 +106,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 @@ -159,6 +160,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 @@ -1594,8 +1594,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
2 changes: 1 addition & 1 deletion ydb/tests/fq/yt/kqprun.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def yql_exec(self, program=None, program_file=None, verbose=False, check_error=T

cmd += '--emulate-yt ' \
'--exclude-linked-udfs ' \
'--clear-execution query ' \
'--execution-case query ' \
'--app-config=%(config_file)s ' \
'--script-query=%(program_file)s ' \
'--scheme-query=%(scheme_file)s ' \
Expand Down
Loading

0 comments on commit 418fff2

Please sign in to comment.