Skip to content

Commit e233be5

Browse files
authored
embedded graphiz (#33623)
1 parent 8e5949d commit e233be5

File tree

4 files changed

+27
-5
lines changed

4 files changed

+27
-5
lines changed

ydb/core/tx/columnshard/diagnostics/scan_diagnostics_actor.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#include "scan_diagnostics_actor.h"
22

3+
#include <ydb/core/mon/mon.h>
4+
35
#include <contrib/libs/fmt/include/fmt/format.h>
46

7+
#include <library/cpp/monlib/service/pages/resource_mon_page.h>
8+
59
namespace NKikimr::NColumnShard::NDiagnostics {
610

711
namespace {
@@ -19,13 +23,17 @@ void ReplaceAll(TString& str, const TString& from, const TString& to) {
1923

2024
}
2125

22-
TScanDiagnosticsActor::TScanDiagnosticsActor()
23-
: TActor(&TThis::StateMain) {
26+
void TScanDiagnosticsActor::Bootstrap() {
27+
TMon* mon = AppData()->Mon;
28+
if (mon) {
29+
mon->Register(new NMonitoring::TResourceMonPage("columnshard/viz-global.js", "viz-global.js", NMonitoring::TResourceMonPage::JAVASCRIPT));
30+
}
31+
Become(&TThis::StateMain);
2432
}
2533

2634
void TScanDiagnosticsActor::Handle(const NMon::TEvRemoteHttpInfo::TPtr& ev) {
2735
TStringBuilder htmlResult;
28-
htmlResult << R"(<script src="https://dreampuf.github.io/GraphvizOnline/viz-global.js"></script>)";
36+
htmlResult << R"(<script language="javascript" type="text/javascript" src="../columnshard/viz-global.js"></script>)";
2937
htmlResult << RenderScanDiagnostics(LastPublicScans, "public");
3038
htmlResult << RenderScanDiagnostics(LastInternalScans, "internal");
3139
Send(ev->Sender, std::make_unique<NMon::TEvRemoteHttpInfoRes>(htmlResult));

ydb/core/tx/columnshard/diagnostics/scan_diagnostics_actor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace NKikimr::NColumnShard::NDiagnostics {
1313

14-
class TScanDiagnosticsActor: public NActors::TActor<TScanDiagnosticsActor> {
14+
class TScanDiagnosticsActor: public NActors::TActorBootstrapped<TScanDiagnosticsActor> {
1515
struct TScanDiagnosticsInfo {
1616
ui64 RequestId;
1717
TString RequestMessage;
@@ -42,7 +42,7 @@ class TScanDiagnosticsActor: public NActors::TActor<TScanDiagnosticsActor> {
4242
void AddScanDiagnostics(const std::shared_ptr<TScanDiagnosticsInfo>& info, std::deque<std::shared_ptr<TScanDiagnosticsInfo>>& lastScans);
4343

4444
public:
45-
TScanDiagnosticsActor();
45+
void Bootstrap();
4646
};
4747

4848
}

ydb/core/tx/columnshard/diagnostics/viz-global.js

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ydb/core/tx/columnshard/diagnostics/ya.make

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,8 @@ PEERDIR(
1414
yql/essentials/core/issue/protos
1515
)
1616

17+
RESOURCE(
18+
viz-global.js viz-global.js
19+
)
20+
1721
END()

0 commit comments

Comments
 (0)