diff options
author | va-kuznecov <va-kuznecov@ydb.tech> | 2022-09-09 12:34:10 +0300 |
---|---|---|
committer | va-kuznecov <va-kuznecov@ydb.tech> | 2022-09-09 12:34:10 +0300 |
commit | 246ca658add29b0073d6234d5f6612dfbb70047f (patch) | |
tree | d771b4600ebbe657aceb1b0c478348a66e5ecf60 | |
parent | 639c0e47f4f63c71f5aeac723275786d2ffa8fab (diff) | |
download | ydb-246ca658add29b0073d6234d5f6612dfbb70047f.tar.gz |
Save KqpLoad test results in memory
-rw-r--r-- | ydb/core/blobstorage/testload/test_load_actor.cpp | 23 | ||||
-rw-r--r-- | ydb/core/blobstorage/testload/test_load_actor.h | 1 | ||||
-rw-r--r-- | ydb/core/blobstorage/testload/test_load_kqp.cpp | 14 |
3 files changed, 21 insertions, 17 deletions
diff --git a/ydb/core/blobstorage/testload/test_load_actor.cpp b/ydb/core/blobstorage/testload/test_load_actor.cpp index 819a31b113..da6da85028 100644 --- a/ydb/core/blobstorage/testload/test_load_actor.cpp +++ b/ydb/core/blobstorage/testload/test_load_actor.cpp @@ -32,6 +32,7 @@ class TLoadActor : public TActorBootstrapped<TLoadActor> { ui64 Tag; TString ErrorReason; TInstant FinishTime; + TString LastHtmlPage; }; // info about finished actors @@ -46,6 +47,9 @@ class TLoadActor : public TActorBootstrapped<TLoadActor> { // HTTP info requests being currently executed THashMap<ui32, THttpInfoRequest> InfoRequests; + // issure tags in ascending order + ui64 NextTag = 1; + TIntrusivePtr<::NMonitoring::TDynamicCounters> Counters; public: @@ -90,11 +94,7 @@ public: if (cmd.HasTag()) { return cmd.GetTag(); } else { - if (LoadActors.empty()) { - return 1; - } else { - return LoadActors.rbegin()->first + 1; - } + return NextTag++; } } @@ -238,7 +238,7 @@ public: LOG_DEBUG_S(ctx, NKikimrServices::BS_LOAD_TEST, "Load actor with tag# " << msg->Tag << " finished"); LoadActors.erase(iter); - FinishedTests.push_back({msg->Tag, msg->ErrorReason, TAppData::TimeProvider->Now()}); + FinishedTests.push_back({msg->Tag, msg->ErrorReason, TAppData::TimeProvider->Now(), msg->LastHtmlPage}); auto it = InfoRequests.begin(); while (it != InfoRequests.end()) { @@ -358,16 +358,15 @@ public: } COLLAPSED_BUTTON_CONTENT("finished_tests_info", "Finished tests") { - for (const auto& req : FinishedTests) { + for (auto it = FinishedTests.rbegin(); it != FinishedTests.rend(); ++it) { DIV_CLASS("panel panel-info") { DIV_CLASS("panel-heading") { - str << "Tag# " << req.Tag; + str << "Tag# " << it->Tag; } DIV_CLASS("panel-body") { - str << "<p>"; - str << "Finish reason# " << req.ErrorReason << "<br/>"; - str << "Finish time# " << req.FinishTime << "<br/>"; - str << "</p>"; + str << "Finish reason# " << it->ErrorReason << "<br/>"; + str << "Finish time# " << it->FinishTime << "<br/>"; + str << it->LastHtmlPage; } } } diff --git a/ydb/core/blobstorage/testload/test_load_actor.h b/ydb/core/blobstorage/testload/test_load_actor.h index 75f8d22758..f741e8017a 100644 --- a/ydb/core/blobstorage/testload/test_load_actor.h +++ b/ydb/core/blobstorage/testload/test_load_actor.h @@ -116,6 +116,7 @@ namespace NKikimr { ui64 Tag; TIntrusivePtr<TLoadReport> Report; // nullptr indicates error TString ErrorReason; + TString LastHtmlPage; TEvTestLoadFinished(ui64 tag, TIntrusivePtr<TLoadReport> report, TString errorReason) : Tag(tag) diff --git a/ydb/core/blobstorage/testload/test_load_kqp.cpp b/ydb/core/blobstorage/testload/test_load_kqp.cpp index e5c9ab3639..b40da8a684 100644 --- a/ydb/core/blobstorage/testload/test_load_kqp.cpp +++ b/ydb/core/blobstorage/testload/test_load_kqp.cpp @@ -495,7 +495,9 @@ private: TIntrusivePtr<TLoadReport> Report(new TLoadReport()); Report->Duration = TDuration::Seconds(DurationSeconds); - ctx.Send(Parent, new TEvTestLoadFinished(Tag, Report, "OK called StartDeathProcess")); + auto* finishEv = new TEvTestLoadFinished(Tag, Report, "OK called StartDeathProcess"); + finishEv->LastHtmlPage = RenderHTML(); + ctx.Send(Parent, finishEv); Die(ctx); } @@ -659,9 +661,7 @@ private: private: - // html render - - void HandleHTML(NMon::TEvHttpInfo::TPtr& ev, const TActorContext& ctx) { + TString RenderHTML() { TStringStream str; HTML(str) { TABLE_CLASS("table table-condensed") { @@ -722,7 +722,11 @@ private: str << "<pre>" << ConfingString << "</pre>"; } } - ctx.Send(ev->Sender, new NMon::TEvHttpInfoRes(str.Str(), ev->Get()->SubRequestId)); + return str.Str(); + } + + void HandleHTML(NMon::TEvHttpInfo::TPtr& ev, const TActorContext& ctx) { + ctx.Send(ev->Sender, new NMon::TEvHttpInfoRes(RenderHTML(), ev->Get()->SubRequestId)); } |