@nimblesite/lsp-profiler-ui 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/out/src/bind-host.d.ts +3 -0
- package/out/src/bind-host.js +52 -0
- package/out/src/bind-host.js.map +1 -0
- package/out/src/context-keys.d.ts +4 -0
- package/out/src/context-keys.js +54 -0
- package/out/src/context-keys.js.map +1 -0
- package/out/src/dap-evaluate.d.ts +84 -0
- package/out/src/dap-evaluate.js +442 -0
- package/out/src/dap-evaluate.js.map +1 -0
- package/out/src/dap-output.d.ts +50 -0
- package/out/src/dap-output.js +177 -0
- package/out/src/dap-output.js.map +1 -0
- package/out/src/debug/adapter-resolution.d.ts +56 -0
- package/out/src/debug/adapter-resolution.js +112 -0
- package/out/src/debug/adapter-resolution.js.map +1 -0
- package/out/src/debug/dap-messages.d.ts +18 -0
- package/out/src/debug/dap-messages.js +71 -0
- package/out/src/debug/dap-messages.js.map +1 -0
- package/out/src/debug/index.d.ts +7 -0
- package/out/src/debug/index.js +27 -0
- package/out/src/debug/index.js.map +1 -0
- package/out/src/debug/launch-config.d.ts +42 -0
- package/out/src/debug/launch-config.js +73 -0
- package/out/src/debug/launch-config.js.map +1 -0
- package/out/src/debug/launch-lifecycle.d.ts +29 -0
- package/out/src/debug/launch-lifecycle.js +40 -0
- package/out/src/debug/launch-lifecycle.js.map +1 -0
- package/out/src/debug/poll.d.ts +25 -0
- package/out/src/debug/poll.js +70 -0
- package/out/src/debug/poll.js.map +1 -0
- package/out/src/debug/profiling.d.ts +34 -0
- package/out/src/debug/profiling.js +81 -0
- package/out/src/debug/profiling.js.map +1 -0
- package/out/src/debug/testing/assertions.d.ts +27 -0
- package/out/src/debug/testing/assertions.js +111 -0
- package/out/src/debug/testing/assertions.js.map +1 -0
- package/out/src/debug/testing/dap-client.d.ts +86 -0
- package/out/src/debug/testing/dap-client.js +204 -0
- package/out/src/debug/testing/dap-client.js.map +1 -0
- package/out/src/debug/testing/index.d.ts +7 -0
- package/out/src/debug/testing/index.js +31 -0
- package/out/src/debug/testing/index.js.map +1 -0
- package/out/src/debug/testing/vscode-harness.d.ts +44 -0
- package/out/src/debug/testing/vscode-harness.js +81 -0
- package/out/src/debug/testing/vscode-harness.js.map +1 -0
- package/out/src/debug/ui-stubs.d.ts +26 -0
- package/out/src/debug/ui-stubs.js +88 -0
- package/out/src/debug/ui-stubs.js.map +1 -0
- package/out/src/debug-link-setup.d.ts +4 -0
- package/out/src/debug-link-setup.js +19 -0
- package/out/src/debug-link-setup.js.map +1 -0
- package/out/src/debug-link-view.d.ts +4 -0
- package/out/src/debug-link-view.js +49 -0
- package/out/src/debug-link-view.js.map +1 -0
- package/out/src/debug-link.d.ts +6 -0
- package/out/src/debug-link.js +95 -0
- package/out/src/debug-link.js.map +1 -0
- package/out/src/debug-selection.d.ts +14 -0
- package/out/src/debug-selection.js +33 -0
- package/out/src/debug-selection.js.map +1 -0
- package/out/src/debuggee-pause.d.ts +11 -0
- package/out/src/debuggee-pause.js +109 -0
- package/out/src/debuggee-pause.js.map +1 -0
- package/out/src/editor-path-key.d.ts +52 -0
- package/out/src/editor-path-key.js +105 -0
- package/out/src/editor-path-key.js.map +1 -0
- package/out/src/failure.d.ts +5 -0
- package/out/src/failure.js +53 -0
- package/out/src/failure.js.map +1 -0
- package/out/src/file-log-sink.d.ts +20 -0
- package/out/src/file-log-sink.js +74 -0
- package/out/src/file-log-sink.js.map +1 -0
- package/out/src/flame-html.d.ts +8 -0
- package/out/src/flame-html.js +104 -0
- package/out/src/flame-html.js.map +1 -0
- package/out/src/flame-model.d.ts +93 -0
- package/out/src/flame-model.js +242 -0
- package/out/src/flame-model.js.map +1 -0
- package/out/src/flame-script-helpers.d.ts +26 -0
- package/out/src/flame-script-helpers.js +71 -0
- package/out/src/flame-script-helpers.js.map +1 -0
- package/out/src/flame-script.d.ts +1 -0
- package/out/src/flame-script.js +332 -0
- package/out/src/flame-script.js.map +1 -0
- package/out/src/flame-time-order.d.ts +14 -0
- package/out/src/flame-time-order.js +112 -0
- package/out/src/flame-time-order.js.map +1 -0
- package/out/src/flamegraph-artifact.d.ts +9 -0
- package/out/src/flamegraph-artifact.js +45 -0
- package/out/src/flamegraph-artifact.js.map +1 -0
- package/out/src/host.d.ts +31 -0
- package/out/src/host.js +6 -0
- package/out/src/host.js.map +1 -0
- package/out/src/ids.d.ts +27 -0
- package/out/src/ids.js +63 -0
- package/out/src/ids.js.map +1 -0
- package/out/src/index.d.ts +42 -0
- package/out/src/index.js +98 -0
- package/out/src/index.js.map +1 -0
- package/out/src/logger.d.ts +50 -0
- package/out/src/logger.js +86 -0
- package/out/src/logger.js.map +1 -0
- package/out/src/memory-autopilot.d.ts +64 -0
- package/out/src/memory-autopilot.js +306 -0
- package/out/src/memory-autopilot.js.map +1 -0
- package/out/src/memory-capture-ids.d.ts +17 -0
- package/out/src/memory-capture-ids.js +45 -0
- package/out/src/memory-capture-ids.js.map +1 -0
- package/out/src/memory-capture-ingest.d.ts +15 -0
- package/out/src/memory-capture-ingest.js +84 -0
- package/out/src/memory-capture-ingest.js.map +1 -0
- package/out/src/memory-capture-legs.d.ts +4 -0
- package/out/src/memory-capture-legs.js +55 -0
- package/out/src/memory-capture-legs.js.map +1 -0
- package/out/src/memory-capture-present.d.ts +32 -0
- package/out/src/memory-capture-present.js +71 -0
- package/out/src/memory-capture-present.js.map +1 -0
- package/out/src/memory-capture-roundtrip.d.ts +17 -0
- package/out/src/memory-capture-roundtrip.js +75 -0
- package/out/src/memory-capture-roundtrip.js.map +1 -0
- package/out/src/memory-capture-state.d.ts +23 -0
- package/out/src/memory-capture-state.js +89 -0
- package/out/src/memory-capture-state.js.map +1 -0
- package/out/src/memory-capture-types.d.ts +28 -0
- package/out/src/memory-capture-types.js +70 -0
- package/out/src/memory-capture-types.js.map +1 -0
- package/out/src/memory-capture.d.ts +24 -0
- package/out/src/memory-capture.js +51 -0
- package/out/src/memory-capture.js.map +1 -0
- package/out/src/memory-dashboard-html.d.ts +3 -0
- package/out/src/memory-dashboard-html.js +327 -0
- package/out/src/memory-dashboard-html.js.map +1 -0
- package/out/src/memory-dashboard-mapping.d.ts +34 -0
- package/out/src/memory-dashboard-mapping.js +135 -0
- package/out/src/memory-dashboard-mapping.js.map +1 -0
- package/out/src/memory-dashboard.d.ts +82 -0
- package/out/src/memory-dashboard.js +142 -0
- package/out/src/memory-dashboard.js.map +1 -0
- package/out/src/memory-decorations.d.ts +61 -0
- package/out/src/memory-decorations.js +247 -0
- package/out/src/memory-decorations.js.map +1 -0
- package/out/src/memory-finalize.d.ts +25 -0
- package/out/src/memory-finalize.js +207 -0
- package/out/src/memory-finalize.js.map +1 -0
- package/out/src/memory-guidance.d.ts +14 -0
- package/out/src/memory-guidance.js +36 -0
- package/out/src/memory-guidance.js.map +1 -0
- package/out/src/memory-inspect-commands.d.ts +20 -0
- package/out/src/memory-inspect-commands.js +114 -0
- package/out/src/memory-inspect-commands.js.map +1 -0
- package/out/src/memory-launch-direct.d.ts +12 -0
- package/out/src/memory-launch-direct.js +74 -0
- package/out/src/memory-launch-direct.js.map +1 -0
- package/out/src/memory-launch.d.ts +4 -0
- package/out/src/memory-launch.js +92 -0
- package/out/src/memory-launch.js.map +1 -0
- package/out/src/memory-leak-offer.d.ts +18 -0
- package/out/src/memory-leak-offer.js +51 -0
- package/out/src/memory-leak-offer.js.map +1 -0
- package/out/src/memory-profiler.d.ts +27 -0
- package/out/src/memory-profiler.js +71 -0
- package/out/src/memory-profiler.js.map +1 -0
- package/out/src/memory-ref-graph.d.ts +62 -0
- package/out/src/memory-ref-graph.js +248 -0
- package/out/src/memory-ref-graph.js.map +1 -0
- package/out/src/memory-ref-picker.d.ts +21 -0
- package/out/src/memory-ref-picker.js +103 -0
- package/out/src/memory-ref-picker.js.map +1 -0
- package/out/src/memory-registration.d.ts +4 -0
- package/out/src/memory-registration.js +63 -0
- package/out/src/memory-registration.js.map +1 -0
- package/out/src/memory-start-core.d.ts +8 -0
- package/out/src/memory-start-core.js +165 -0
- package/out/src/memory-start-core.js.map +1 -0
- package/out/src/memory-start-stop-commands.d.ts +10 -0
- package/out/src/memory-start-stop-commands.js +75 -0
- package/out/src/memory-start-stop-commands.js.map +1 -0
- package/out/src/memory-start.d.ts +6 -0
- package/out/src/memory-start.js +13 -0
- package/out/src/memory-start.js.map +1 -0
- package/out/src/memory-status.d.ts +24 -0
- package/out/src/memory-status.js +135 -0
- package/out/src/memory-status.js.map +1 -0
- package/out/src/palette-vscode.d.ts +2 -0
- package/out/src/palette-vscode.js +50 -0
- package/out/src/palette-vscode.js.map +1 -0
- package/out/src/palette.d.ts +70 -0
- package/out/src/palette.js +150 -0
- package/out/src/palette.js.map +1 -0
- package/out/src/process-bind-panel.d.ts +11 -0
- package/out/src/process-bind-panel.js +65 -0
- package/out/src/process-bind-panel.js.map +1 -0
- package/out/src/process-commands.d.ts +5 -0
- package/out/src/process-commands.js +112 -0
- package/out/src/process-commands.js.map +1 -0
- package/out/src/process-context-keys.d.ts +11 -0
- package/out/src/process-context-keys.js +48 -0
- package/out/src/process-context-keys.js.map +1 -0
- package/out/src/process-decoration.d.ts +18 -0
- package/out/src/process-decoration.js +76 -0
- package/out/src/process-decoration.js.map +1 -0
- package/out/src/process-explorer-rows.d.ts +59 -0
- package/out/src/process-explorer-rows.js +47 -0
- package/out/src/process-explorer-rows.js.map +1 -0
- package/out/src/process-explorer.d.ts +66 -0
- package/out/src/process-explorer.js +241 -0
- package/out/src/process-explorer.js.map +1 -0
- package/out/src/process-group-item.d.ts +8 -0
- package/out/src/process-group-item.js +55 -0
- package/out/src/process-group-item.js.map +1 -0
- package/out/src/process-launch-item.d.ts +12 -0
- package/out/src/process-launch-item.js +57 -0
- package/out/src/process-launch-item.js.map +1 -0
- package/out/src/process-launch.d.ts +47 -0
- package/out/src/process-launch.js +205 -0
- package/out/src/process-launch.js.map +1 -0
- package/out/src/process-message-item.d.ts +10 -0
- package/out/src/process-message-item.js +53 -0
- package/out/src/process-message-item.js.map +1 -0
- package/out/src/process-poll.d.ts +26 -0
- package/out/src/process-poll.js +125 -0
- package/out/src/process-poll.js.map +1 -0
- package/out/src/process-reactivity.d.ts +55 -0
- package/out/src/process-reactivity.js +188 -0
- package/out/src/process-reactivity.js.map +1 -0
- package/out/src/process-registration.d.ts +11 -0
- package/out/src/process-registration.js +55 -0
- package/out/src/process-registration.js.map +1 -0
- package/out/src/process-tree-item.d.ts +18 -0
- package/out/src/process-tree-item.js +219 -0
- package/out/src/process-tree-item.js.map +1 -0
- package/out/src/processes-state.d.ts +75 -0
- package/out/src/processes-state.js +76 -0
- package/out/src/processes-state.js.map +1 -0
- package/out/src/profile-on-launch.d.ts +4 -0
- package/out/src/profile-on-launch.js +16 -0
- package/out/src/profile-on-launch.js.map +1 -0
- package/out/src/profile-server.d.ts +24 -0
- package/out/src/profile-server.js +170 -0
- package/out/src/profile-server.js.map +1 -0
- package/out/src/profiler-attach.d.ts +19 -0
- package/out/src/profiler-attach.js +129 -0
- package/out/src/profiler-attach.js.map +1 -0
- package/out/src/profiler-commands.d.ts +8 -0
- package/out/src/profiler-commands.js +110 -0
- package/out/src/profiler-commands.js.map +1 -0
- package/out/src/profiler-decorations.d.ts +74 -0
- package/out/src/profiler-decorations.js +237 -0
- package/out/src/profiler-decorations.js.map +1 -0
- package/out/src/profiler-dispose.d.ts +6 -0
- package/out/src/profiler-dispose.js +20 -0
- package/out/src/profiler-dispose.js.map +1 -0
- package/out/src/profiler-flamegraph-html.d.ts +61 -0
- package/out/src/profiler-flamegraph-html.js +366 -0
- package/out/src/profiler-flamegraph-html.js.map +1 -0
- package/out/src/profiler-format.d.ts +10 -0
- package/out/src/profiler-format.js +28 -0
- package/out/src/profiler-format.js.map +1 -0
- package/out/src/profiler-launch-cooperative.d.ts +16 -0
- package/out/src/profiler-launch-cooperative.js +167 -0
- package/out/src/profiler-launch-cooperative.js.map +1 -0
- package/out/src/profiler-launch.d.ts +29 -0
- package/out/src/profiler-launch.js +123 -0
- package/out/src/profiler-launch.js.map +1 -0
- package/out/src/profiler-results.d.ts +22 -0
- package/out/src/profiler-results.js +104 -0
- package/out/src/profiler-results.js.map +1 -0
- package/out/src/profiler-session-core.d.ts +42 -0
- package/out/src/profiler-session-core.js +116 -0
- package/out/src/profiler-session-core.js.map +1 -0
- package/out/src/profiler-state.d.ts +87 -0
- package/out/src/profiler-state.js +83 -0
- package/out/src/profiler-state.js.map +1 -0
- package/out/src/profiler-status.d.ts +38 -0
- package/out/src/profiler-status.js +163 -0
- package/out/src/profiler-status.js.map +1 -0
- package/out/src/profiler-styles.d.ts +21 -0
- package/out/src/profiler-styles.js +160 -0
- package/out/src/profiler-styles.js.map +1 -0
- package/out/src/profiler-webview.d.ts +95 -0
- package/out/src/profiler-webview.js +243 -0
- package/out/src/profiler-webview.js.map +1 -0
- package/out/src/profiler.d.ts +23 -0
- package/out/src/profiler.js +113 -0
- package/out/src/profiler.js.map +1 -0
- package/out/src/progress-ops.d.ts +24 -0
- package/out/src/progress-ops.js +135 -0
- package/out/src/progress-ops.js.map +1 -0
- package/out/src/reactive-refresh.d.ts +24 -0
- package/out/src/reactive-refresh.js +33 -0
- package/out/src/reactive-refresh.js.map +1 -0
- package/out/src/sample-summary.d.ts +39 -0
- package/out/src/sample-summary.js +32 -0
- package/out/src/sample-summary.js.map +1 -0
- package/out/src/sampled-view.d.ts +15 -0
- package/out/src/sampled-view.js +56 -0
- package/out/src/sampled-view.js.map +1 -0
- package/out/src/server-command.d.ts +4 -0
- package/out/src/server-command.js +14 -0
- package/out/src/server-command.js.map +1 -0
- package/out/src/settings.d.ts +1 -0
- package/out/src/settings.js +22 -0
- package/out/src/settings.js.map +1 -0
- package/out/src/store.d.ts +34 -0
- package/out/src/store.js +64 -0
- package/out/src/store.js.map +1 -0
- package/out/src/testing/cpu-capture-assertions.d.ts +8 -0
- package/out/src/testing/cpu-capture-assertions.js +71 -0
- package/out/src/testing/cpu-capture-assertions.js.map +1 -0
- package/out/src/testing/cpu-capture-contract.d.ts +8 -0
- package/out/src/testing/cpu-capture-contract.js +123 -0
- package/out/src/testing/cpu-capture-contract.js.map +1 -0
- package/out/src/testing/webview-contract-helpers.d.ts +24 -0
- package/out/src/testing/webview-contract-helpers.js +125 -0
- package/out/src/testing/webview-contract-helpers.js.map +1 -0
- package/out/src/testing/webview-contract-leak.d.ts +2 -0
- package/out/src/testing/webview-contract-leak.js +80 -0
- package/out/src/testing/webview-contract-leak.js.map +1 -0
- package/out/src/testing/webview-contract-memory.d.ts +5 -0
- package/out/src/testing/webview-contract-memory.js +221 -0
- package/out/src/testing/webview-contract-memory.js.map +1 -0
- package/out/src/testing/webview-contract-palette.d.ts +6 -0
- package/out/src/testing/webview-contract-palette.js +121 -0
- package/out/src/testing/webview-contract-palette.js.map +1 -0
- package/out/src/testing/webview-contract-panel.d.ts +7 -0
- package/out/src/testing/webview-contract-panel.js +100 -0
- package/out/src/testing/webview-contract-panel.js.map +1 -0
- package/out/src/testing/webview-contract-results.d.ts +6 -0
- package/out/src/testing/webview-contract-results.js +136 -0
- package/out/src/testing/webview-contract-results.js.map +1 -0
- package/out/src/testing/webview-contract.d.ts +18 -0
- package/out/src/testing/webview-contract.js +23 -0
- package/out/src/testing/webview-contract.js.map +1 -0
- package/out/src/timeouts.d.ts +21 -0
- package/out/src/timeouts.js +30 -0
- package/out/src/timeouts.js.map +1 -0
- package/out/src/trace-actions.d.ts +33 -0
- package/out/src/trace-actions.js +135 -0
- package/out/src/trace-actions.js.map +1 -0
- package/out/src/unknown-shape.d.ts +58 -0
- package/out/src/unknown-shape.js +110 -0
- package/out/src/unknown-shape.js.map +1 -0
- package/out/src/wire-adapters.d.ts +18 -0
- package/out/src/wire-adapters.js +160 -0
- package/out/src/wire-adapters.js.map +1 -0
- package/out/src/wire-generated.d.ts +760 -0
- package/out/src/wire-generated.js +38 -0
- package/out/src/wire-generated.js.map +1 -0
- package/package.json +53 -4
- package/scripts/contributions.mjs +187 -0
- package/README.md +0 -3
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Which suspected leak the autopilot offers, and how the offer names it.
|
|
4
|
+
*
|
|
5
|
+
* A runtime reports a leak's type, its source line, both or neither: a .NET
|
|
6
|
+
* `byte[]` grown by user code has a type and no line of its own. The offer
|
|
7
|
+
* named every leak by `file:line`, so a type-only leak read "Suspected memory
|
|
8
|
+
* leak at :0". It now names what the runtime reported, and among equally
|
|
9
|
+
* confident leaks it offers one the user can open at its line.
|
|
10
|
+
*
|
|
11
|
+
* Implements [PROF-UI-AUTOPILOT].
|
|
12
|
+
*/
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.isLocated = isLocated;
|
|
18
|
+
exports.leakToOffer = leakToOffer;
|
|
19
|
+
exports.describeLeak = describeLeak;
|
|
20
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
21
|
+
const memory_decorations_1 = require("./memory-decorations");
|
|
22
|
+
/** Whether the runtime placed `leak` on a source line. */
|
|
23
|
+
function isLocated(leak) {
|
|
24
|
+
return leak.file !== "" && leak.line > 0;
|
|
25
|
+
}
|
|
26
|
+
/** The leak to offer: the most confident, and among equals one with a source line. */
|
|
27
|
+
function leakToOffer(leaks) {
|
|
28
|
+
let best = undefined;
|
|
29
|
+
for (const leak of leaks) {
|
|
30
|
+
if (best === undefined || offerRank(leak) > offerRank(best)) {
|
|
31
|
+
best = leak;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return best;
|
|
35
|
+
}
|
|
36
|
+
/** Confidence first; a source line only breaks a tie. */
|
|
37
|
+
function offerRank(leak) {
|
|
38
|
+
return (0, memory_decorations_1.confidenceRank)(leak.confidence) * 2 + (isLocated(leak) ? 1 : 0);
|
|
39
|
+
}
|
|
40
|
+
/** How an offer names `leak`: its type and its source line, as far as the runtime reported them. */
|
|
41
|
+
function describeLeak(leak) {
|
|
42
|
+
const at = isLocated(leak) ? `${node_path_1.default.basename(leak.file)}:${String(leak.line)}` : "";
|
|
43
|
+
if (leak.typeName !== "" && at !== "") {
|
|
44
|
+
return `${leak.typeName} at ${at}`;
|
|
45
|
+
}
|
|
46
|
+
if (leak.typeName !== "") {
|
|
47
|
+
return leak.typeName;
|
|
48
|
+
}
|
|
49
|
+
return at === "" ? "an allocation the runtime did not name" : at;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=memory-leak-offer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-leak-offer.js","sourceRoot":"","sources":["../../src/memory-leak-offer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;AAEH,0DAA6B;AAE7B,6DAAsD;AAEtD,0DAA0D;AAC1D,mBAA0B,IAAmB;IAC3C,OAAO,IAAI,CAAC,IAAI,KAAK,EAAE,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;AAC3C,CAAC;AAED,sFAAsF;AACtF,qBAA4B,KAA+B;IACzD,IAAI,IAAI,GAA8B,SAAS,CAAC;IAChD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,KAAK,SAAS,IAAI,SAAS,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;YAC5D,IAAI,GAAG,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,yDAAyD;AACzD,SAAS,SAAS,CAAC,IAAmB;IACpC,OAAO,IAAA,mCAAc,EAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACzE,CAAC;AAED,oGAAoG;AACpG,sBAA6B,IAAmB;IAC9C,MAAM,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,mBAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACrF,IAAI,IAAI,CAAC,QAAQ,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,OAAO,EAAE,EAAE,CAAC;IAAC,CAAC;IAC9E,IAAI,IAAI,CAAC,QAAQ,KAAK,EAAE,EAAE,CAAC;QAAC,OAAO,IAAI,CAAC,QAAQ,CAAC;IAAC,CAAC;IACnD,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,wCAAwC,CAAC,CAAC,CAAC,EAAE,CAAC;AACnE,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Memory profiler command + lifecycle layer for the lsp-profiler UI library.
|
|
3
|
+
*
|
|
4
|
+
* Owns the `<prefix>.profiler.memory*` command registrations and the memory
|
|
5
|
+
* status-bar indicator. Starting lives in [`memory-start.ts`](./memory-start.ts),
|
|
6
|
+
* stopping and the at-exit finalisation ([PROF-PY-MEMORY-FINAL]) in
|
|
7
|
+
* [`memory-finalize.ts`](./memory-finalize.ts), the editor-as-courier round-trip
|
|
8
|
+
* and result presentation in [`memory-capture.ts`](./memory-capture.ts), the
|
|
9
|
+
* reference-graph type picker in [`memory-ref-picker.ts`](./memory-ref-picker.ts)
|
|
10
|
+
* and the automatic per-pause / interval capture in
|
|
11
|
+
* [`memory-autopilot.ts`](./memory-autopilot.ts). All memory analysis logic lives
|
|
12
|
+
* in the LSP — this module is client-side UI and command routing.
|
|
13
|
+
*/
|
|
14
|
+
import type * as vscode from "vscode";
|
|
15
|
+
import type { ProfilerStore as Store } from "./store";
|
|
16
|
+
export { memoryStatusText } from "./memory-status";
|
|
17
|
+
export { gcSummary } from "./memory-inspect-commands";
|
|
18
|
+
/** Register memory profiler commands and UI components. */
|
|
19
|
+
export declare function registerMemoryProfiler(store: Store): vscode.Disposable[];
|
|
20
|
+
/**
|
|
21
|
+
* The active memory-tracking session id, or undefined when not tracking.
|
|
22
|
+
* E2e seam for [PROF-UI-MEMORY]/[PROF-UI-PROCESSES]: lets
|
|
23
|
+
* tests observe that tracking really started (e.g. the track-on-launch flow).
|
|
24
|
+
*/
|
|
25
|
+
export declare function activeMemorySession(): string | undefined;
|
|
26
|
+
/** Clean up memory profiler resources. */
|
|
27
|
+
export declare function disposeMemoryProfiler(): void;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Implements [PROF-UI]. See docs/specs/LSP-PROFILER-SPEC.md
|
|
3
|
+
/**
|
|
4
|
+
* Memory profiler command + lifecycle layer for the lsp-profiler UI library.
|
|
5
|
+
*
|
|
6
|
+
* Owns the `<prefix>.profiler.memory*` command registrations and the memory
|
|
7
|
+
* status-bar indicator. Starting lives in [`memory-start.ts`](./memory-start.ts),
|
|
8
|
+
* stopping and the at-exit finalisation ([PROF-PY-MEMORY-FINAL]) in
|
|
9
|
+
* [`memory-finalize.ts`](./memory-finalize.ts), the editor-as-courier round-trip
|
|
10
|
+
* and result presentation in [`memory-capture.ts`](./memory-capture.ts), the
|
|
11
|
+
* reference-graph type picker in [`memory-ref-picker.ts`](./memory-ref-picker.ts)
|
|
12
|
+
* and the automatic per-pause / interval capture in
|
|
13
|
+
* [`memory-autopilot.ts`](./memory-autopilot.ts). All memory analysis logic lives
|
|
14
|
+
* in the LSP — this module is client-side UI and command routing.
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.gcSummary = exports.memoryStatusText = void 0;
|
|
18
|
+
exports.registerMemoryProfiler = registerMemoryProfiler;
|
|
19
|
+
exports.activeMemorySession = activeMemorySession;
|
|
20
|
+
exports.disposeMemoryProfiler = disposeMemoryProfiler;
|
|
21
|
+
const memory_status_1 = require("./memory-status");
|
|
22
|
+
const memory_dashboard_1 = require("./memory-dashboard");
|
|
23
|
+
const memory_ref_graph_1 = require("./memory-ref-graph");
|
|
24
|
+
const memory_decorations_1 = require("./memory-decorations");
|
|
25
|
+
const memory_capture_1 = require("./memory-capture");
|
|
26
|
+
const memory_finalize_1 = require("./memory-finalize");
|
|
27
|
+
const memory_registration_1 = require("./memory-registration");
|
|
28
|
+
// Re-exported so tests keep one import site for the memory profiler's seams.
|
|
29
|
+
var memory_status_2 = require("./memory-status");
|
|
30
|
+
Object.defineProperty(exports, "memoryStatusText", { enumerable: true, get: function () { return memory_status_2.memoryStatusText; } });
|
|
31
|
+
var memory_inspect_commands_1 = require("./memory-inspect-commands");
|
|
32
|
+
Object.defineProperty(exports, "gcSummary", { enumerable: true, get: function () { return memory_inspect_commands_1.gcSummary; } });
|
|
33
|
+
// ── State ─────────────────────────────────────────────────────────────────
|
|
34
|
+
//
|
|
35
|
+
// Memory-tracking session state lives in the store as a reactive signal
|
|
36
|
+
// ([PROF-UI-PROCESSES]); `boundStore` is the handle this module reads
|
|
37
|
+
// it through (and the e2e seam reads it through `activeMemorySession`).
|
|
38
|
+
let boundStore = null;
|
|
39
|
+
// ── Registration ──────────────────────────────────────────────────────────
|
|
40
|
+
/** Register memory profiler commands and UI components. */
|
|
41
|
+
function registerMemoryProfiler(store) {
|
|
42
|
+
boundStore = store;
|
|
43
|
+
return [
|
|
44
|
+
// The memory status-bar item — its whole lifecycle (idle affordance,
|
|
45
|
+
// starting spinner, tracking readout) lives in memory-status.ts.
|
|
46
|
+
...(0, memory_status_1.bindMemoryStatusBar)(store),
|
|
47
|
+
...(0, memory_registration_1.memoryCommandDisposables)(store),
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
/** Whether memory tracking is currently live, per the store. */
|
|
51
|
+
function isTracking() {
|
|
52
|
+
return boundStore?.profiler.value.memory === "active";
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The active memory-tracking session id, or undefined when not tracking.
|
|
56
|
+
* E2e seam for [PROF-UI-MEMORY]/[PROF-UI-PROCESSES]: lets
|
|
57
|
+
* tests observe that tracking really started (e.g. the track-on-launch flow).
|
|
58
|
+
*/
|
|
59
|
+
function activeMemorySession() {
|
|
60
|
+
return isTracking() ? boundStore?.profiler.value.memorySessionId : undefined;
|
|
61
|
+
}
|
|
62
|
+
/** Clean up memory profiler resources. */
|
|
63
|
+
function disposeMemoryProfiler() {
|
|
64
|
+
(0, memory_decorations_1.clearMemoryDecorations)();
|
|
65
|
+
(0, memory_decorations_1.disposeMemoryDecorations)();
|
|
66
|
+
(0, memory_ref_graph_1.disposeRefGraph)();
|
|
67
|
+
(0, memory_dashboard_1.disposeMemoryDashboard)();
|
|
68
|
+
(0, memory_capture_1.resetCaptureState)();
|
|
69
|
+
(0, memory_finalize_1.clearPendingSnapshotCleanup)();
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=memory-profiler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-profiler.js","sourceRoot":"","sources":["../../src/memory-profiler.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D;;;;;;;;;;;;GAYG;;;;;;AAIH,mDAAsD;AACtD,yDAA4D;AAC5D,yDAAqD;AACrD,6DAAwF;AACxF,qDAAqD;AACrD,uDAAgE;AAChE,+DAAiE;AAEjE,6EAA6E;AAC7E,iDAAmD;AAA1C,iHAAA,gBAAgB,OAAA;AACzB,qEAAsD;AAA7C,oHAAA,SAAS,OAAA;AAElB,6EAA6E;AAC7E,EAAE;AACF,wEAAwE;AACxE,sEAAsE;AACtE,wEAAwE;AAExE,IAAI,UAAU,GAAiB,IAAI,CAAC;AAEpC,6EAA6E;AAE7E,2DAA2D;AAC3D,gCAAuC,KAAY;IACjD,UAAU,GAAG,KAAK,CAAC;IACnB,OAAO;QACL,qEAAqE;QACrE,iEAAiE;QACjE,GAAG,IAAA,mCAAmB,EAAC,KAAK,CAAC;QAC7B,GAAG,IAAA,8CAAwB,EAAC,KAAK,CAAC;KACnC,CAAC;AACJ,CAAC;AAED,gEAAgE;AAChE,SAAS,UAAU;IACjB,OAAO,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,KAAK,QAAQ,CAAC;AACxD,CAAC;AAED;;;;GAIG;AACH;IACE,OAAO,UAAU,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/E,CAAC;AAED,0CAA0C;AAC1C;IACE,IAAA,2CAAsB,GAAE,CAAC;IACzB,IAAA,6CAAwB,GAAE,CAAC;IAC3B,IAAA,kCAAe,GAAE,CAAC;IAClB,IAAA,yCAAsB,GAAE,CAAC;IACzB,IAAA,kCAAiB,GAAE,CAAC;IACpB,IAAA,6CAA2B,GAAE,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reference-graph webview for memory profiling.
|
|
3
|
+
*
|
|
4
|
+
* Renders the object-retention graph in a Canvas 2D webview, layered by each
|
|
5
|
+
* object's distance from the targets: GC roots on top, named by their labels.
|
|
6
|
+
* Extracted from `memory-profiler.ts` so that module stays focused on command
|
|
7
|
+
* routing and the courier round-trip.
|
|
8
|
+
*
|
|
9
|
+
* Panel lifecycle, CSP, and safe data embedding come from the shared webview
|
|
10
|
+
* host ([PROF-UI-WEBVIEW], profiler-webview.ts) — node `repr`/type strings
|
|
11
|
+
* come from the profiled program and must never escape the inline script.
|
|
12
|
+
*/
|
|
13
|
+
/** Reference-graph result returned by `<prefix>.lspProfiler.memory.ingest` (kind `refs`). */
|
|
14
|
+
export interface ReferenceGraphResult {
|
|
15
|
+
targetType: string;
|
|
16
|
+
maxDepth: number;
|
|
17
|
+
maxNodes: number;
|
|
18
|
+
script: string;
|
|
19
|
+
graph?: {
|
|
20
|
+
nodes: RefGraphNode[];
|
|
21
|
+
edges: RefGraphEdge[];
|
|
22
|
+
cycles: number[][];
|
|
23
|
+
retentionPath?: string[];
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
interface RefGraphNode {
|
|
27
|
+
id: number;
|
|
28
|
+
type: string;
|
|
29
|
+
size: number;
|
|
30
|
+
repr: string;
|
|
31
|
+
depth: number;
|
|
32
|
+
isTarget: boolean;
|
|
33
|
+
/** A garbage-collection root; `repr` is then its root label, such as `static sessions`. */
|
|
34
|
+
isRoot?: boolean;
|
|
35
|
+
rootKind?: string | undefined;
|
|
36
|
+
}
|
|
37
|
+
interface RefGraphEdge {
|
|
38
|
+
from: number;
|
|
39
|
+
to: number;
|
|
40
|
+
label: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Decode the graph payload of a `kind: "refs"` ingest result.
|
|
44
|
+
*
|
|
45
|
+
* Node `repr`/`type` strings come straight from the profiled program, so every
|
|
46
|
+
* field is coerced here rather than asserted — a malformed node becomes an
|
|
47
|
+
* empty-ish node instead of an `undefined` the canvas renderer would trip on.
|
|
48
|
+
*/
|
|
49
|
+
export declare function decodeRefGraph(value: unknown): ReferenceGraphResult["graph"];
|
|
50
|
+
/** The open retention graph's view type, title and HTML (e2e seam). */
|
|
51
|
+
export declare function refGraphState(): {
|
|
52
|
+
readonly viewType: string;
|
|
53
|
+
readonly title: string;
|
|
54
|
+
readonly html: string;
|
|
55
|
+
} | undefined;
|
|
56
|
+
/** Open (or reveal) the retention-graph webview for a parsed reference graph. */
|
|
57
|
+
export declare function openRefGraphWebview(result: ReferenceGraphResult): void;
|
|
58
|
+
/** Dispose the reference-graph webview, if open. */
|
|
59
|
+
export declare function disposeRefGraph(): void;
|
|
60
|
+
/** Build the complete retention-graph HTML (exported as an e2e seam). */
|
|
61
|
+
export declare function buildRefGraphHtml(result: ReferenceGraphResult): string;
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Implements [PROF-UI]. See docs/specs/LSP-PROFILER-SPEC.md
|
|
3
|
+
/**
|
|
4
|
+
* Reference-graph webview for memory profiling.
|
|
5
|
+
*
|
|
6
|
+
* Renders the object-retention graph in a Canvas 2D webview, layered by each
|
|
7
|
+
* object's distance from the targets: GC roots on top, named by their labels.
|
|
8
|
+
* Extracted from `memory-profiler.ts` so that module stays focused on command
|
|
9
|
+
* routing and the courier round-trip.
|
|
10
|
+
*
|
|
11
|
+
* Panel lifecycle, CSP, and safe data embedding come from the shared webview
|
|
12
|
+
* host ([PROF-UI-WEBVIEW], profiler-webview.ts) — node `repr`/type strings
|
|
13
|
+
* come from the profiled program and must never escape the inline script.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.decodeRefGraph = decodeRefGraph;
|
|
17
|
+
exports.refGraphState = refGraphState;
|
|
18
|
+
exports.openRefGraphWebview = openRefGraphWebview;
|
|
19
|
+
exports.disposeRefGraph = disposeRefGraph;
|
|
20
|
+
exports.buildRefGraphHtml = buildRefGraphHtml;
|
|
21
|
+
const ids_1 = require("./ids");
|
|
22
|
+
const profiler_styles_1 = require("./profiler-styles");
|
|
23
|
+
const unknown_shape_1 = require("./unknown-shape");
|
|
24
|
+
const profiler_webview_1 = require("./profiler-webview");
|
|
25
|
+
/**
|
|
26
|
+
* Decode the graph payload of a `kind: "refs"` ingest result.
|
|
27
|
+
*
|
|
28
|
+
* Node `repr`/`type` strings come straight from the profiled program, so every
|
|
29
|
+
* field is coerced here rather than asserted — a malformed node becomes an
|
|
30
|
+
* empty-ish node instead of an `undefined` the canvas renderer would trip on.
|
|
31
|
+
*/
|
|
32
|
+
function decodeRefGraph(value) {
|
|
33
|
+
if (!(0, unknown_shape_1.isRecord)(value)) {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
nodes: (0, unknown_shape_1.recordArrayField)(value, "nodes").map((node) => toRefNode(node)),
|
|
38
|
+
edges: (0, unknown_shape_1.recordArrayField)(value, "edges").map((edge) => ({
|
|
39
|
+
from: (0, unknown_shape_1.numberField)(edge, "from") ?? 0,
|
|
40
|
+
to: (0, unknown_shape_1.numberField)(edge, "to") ?? 0,
|
|
41
|
+
label: (0, unknown_shape_1.stringField)(edge, "label") ?? "",
|
|
42
|
+
})),
|
|
43
|
+
cycles: (0, unknown_shape_1.arrayField)(value, "cycles").map((cycle) => Array.isArray(cycle) ? cycle.filter((id) => typeof id === "number") : []),
|
|
44
|
+
retentionPath: (0, unknown_shape_1.stringArrayField)(value, "retentionPath"),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function toRefNode(node) {
|
|
48
|
+
return {
|
|
49
|
+
id: (0, unknown_shape_1.numberField)(node, "id") ?? 0,
|
|
50
|
+
type: (0, unknown_shape_1.stringField)(node, "type") ?? "",
|
|
51
|
+
size: (0, unknown_shape_1.numberField)(node, "size") ?? 0,
|
|
52
|
+
repr: (0, unknown_shape_1.stringField)(node, "repr") ?? "",
|
|
53
|
+
depth: (0, unknown_shape_1.numberField)(node, "depth") ?? 0,
|
|
54
|
+
isTarget: (0, unknown_shape_1.booleanField)(node, "isTarget") ?? false,
|
|
55
|
+
isRoot: (0, unknown_shape_1.booleanField)(node, "isRoot") ?? false,
|
|
56
|
+
rootKind: (0, unknown_shape_1.stringField)(node, "rootKind"),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
const refGraphPanel = new profiler_webview_1.SingletonWebviewPanel(() => (0, ids_1.cmd)("refGraph"), (msg) => {
|
|
60
|
+
(0, profiler_webview_1.handleSourceNavigation)(msg);
|
|
61
|
+
});
|
|
62
|
+
/** The open retention graph's view type, title and HTML (e2e seam). */
|
|
63
|
+
function refGraphState() {
|
|
64
|
+
const described = refGraphPanel.describe();
|
|
65
|
+
return described === undefined ? undefined : { ...described, html: refGraphPanel.html() ?? "" };
|
|
66
|
+
}
|
|
67
|
+
/** Open (or reveal) the retention-graph webview for a parsed reference graph. */
|
|
68
|
+
function openRefGraphWebview(result) {
|
|
69
|
+
refGraphPanel.show(`Retention Graph — ${result.targetType}`, buildRefGraphHtml(result));
|
|
70
|
+
}
|
|
71
|
+
/** Dispose the reference-graph webview, if open. */
|
|
72
|
+
function disposeRefGraph() {
|
|
73
|
+
refGraphPanel.dispose();
|
|
74
|
+
}
|
|
75
|
+
const REF_GRAPH_CSS = `${profiler_styles_1.PROFILER_CSS_VARS}${profiler_styles_1.PROFILER_CSS_RESET}
|
|
76
|
+
body { padding: 16px; }
|
|
77
|
+
h1 { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
|
|
78
|
+
h1 .accent { color: var(--prof-mem-critical); }
|
|
79
|
+
.retention-path {
|
|
80
|
+
background: var(--prof-surface);
|
|
81
|
+
border: 1px solid var(--prof-border);
|
|
82
|
+
border-radius: 8px;
|
|
83
|
+
padding: 12px 16px;
|
|
84
|
+
margin-bottom: 16px;
|
|
85
|
+
font-family: 'JetBrains Mono', monospace;
|
|
86
|
+
font-size: 12px;
|
|
87
|
+
line-height: 1.8;
|
|
88
|
+
}
|
|
89
|
+
.retention-path .label {
|
|
90
|
+
font-size: 11px;
|
|
91
|
+
color: var(--prof-text-secondary);
|
|
92
|
+
text-transform: uppercase;
|
|
93
|
+
letter-spacing: 0.05em;
|
|
94
|
+
margin-bottom: 6px;
|
|
95
|
+
}
|
|
96
|
+
.retention-path .step { color: var(--prof-info); }
|
|
97
|
+
.retention-path .target { color: var(--prof-mem-critical); font-weight: 600; }
|
|
98
|
+
canvas { display: block; width: 100%; border-radius: 8px; background: var(--prof-surface); }
|
|
99
|
+
.legend {
|
|
100
|
+
display: flex; gap: 16px; margin-top: 12px; font-size: 11px;
|
|
101
|
+
color: var(--prof-text-secondary);
|
|
102
|
+
}
|
|
103
|
+
.legend-item { display: flex; align-items: center; gap: 4px; }
|
|
104
|
+
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
|
|
105
|
+
.no-data { text-align: center; padding: 60px; color: var(--prof-text-secondary); }`;
|
|
106
|
+
function buildRetentionPathHtml(retentionPath) {
|
|
107
|
+
if (retentionPath.length === 0) {
|
|
108
|
+
return "";
|
|
109
|
+
}
|
|
110
|
+
const steps = retentionPath
|
|
111
|
+
.map((step, i) => `<div class="${i === retentionPath.length - 1 ? "target" : "step"}">${(0, profiler_styles_1.escapeHtml)(step)}</div>`)
|
|
112
|
+
.join("\n ");
|
|
113
|
+
return `<div class="retention-path">
|
|
114
|
+
<div class="label">Retention Path</div>
|
|
115
|
+
${steps}
|
|
116
|
+
</div>`;
|
|
117
|
+
}
|
|
118
|
+
/** The graph as script constants. */
|
|
119
|
+
function refGraphDataScript(nodesJson, edgesJson, cyclesJson) {
|
|
120
|
+
return `
|
|
121
|
+
const nodes = ${nodesJson};
|
|
122
|
+
const edges = ${edgesJson};
|
|
123
|
+
const cycles = ${cyclesJson};
|
|
124
|
+
`;
|
|
125
|
+
}
|
|
126
|
+
/** An honest empty state, or each node laid out in a layer by its distance from the targets. */
|
|
127
|
+
const REF_GRAPH_LAYOUT_SCRIPT = `
|
|
128
|
+
if (nodes.length === 0) {
|
|
129
|
+
document.getElementById('graph').style.display = 'none';
|
|
130
|
+
const noData = document.createElement('div');
|
|
131
|
+
noData.className = 'no-data';
|
|
132
|
+
noData.textContent = 'No reference graph data available. Run the memory references command with an active debug session.';
|
|
133
|
+
document.body.appendChild(noData);
|
|
134
|
+
} else {
|
|
135
|
+
const canvas = document.getElementById('graph');
|
|
136
|
+
const ctx = canvas.getContext('2d');
|
|
137
|
+
// Fill the panel width so the graph is not letterboxed into 800px.
|
|
138
|
+
const W = canvas.width = Math.max(800, canvas.parentElement ? canvas.clientWidth : 800);
|
|
139
|
+
// Layers by distance from the targets: roots on top, targets along the bottom.
|
|
140
|
+
const LAYER = 120;
|
|
141
|
+
const top = Math.max(...nodes.map((n) => n.depth));
|
|
142
|
+
const H = canvas.height = Math.max(360, (top + 1) * LAYER + 40);
|
|
143
|
+
const cycleNodeIds = new Set(cycles.flat());
|
|
144
|
+
const layers = new Map();
|
|
145
|
+
nodes.forEach((n) => layers.set(n.depth, [...(layers.get(n.depth) || []), n]));
|
|
146
|
+
const nodeMap = new Map();
|
|
147
|
+
for (const [depth, members] of layers) {
|
|
148
|
+
const gap = W / (members.length + 1);
|
|
149
|
+
// A row too tight to label each node names its type once, with a count.
|
|
150
|
+
const crowded = gap < 160;
|
|
151
|
+
members.forEach((n, i) => nodeMap.set(n.id, {
|
|
152
|
+
...n,
|
|
153
|
+
x: gap * (i + 1),
|
|
154
|
+
y: 60 + (top - depth) * LAYER,
|
|
155
|
+
crowded,
|
|
156
|
+
radius: Math.min(crowded ? gap / 2.5 : 30, Math.max(8, Math.log2(Math.max(n.size, 1)) * 2)),
|
|
157
|
+
}));
|
|
158
|
+
}`;
|
|
159
|
+
/** Edges, a cycle's in the leak colour. */
|
|
160
|
+
const REF_GRAPH_EDGES_SCRIPT = `
|
|
161
|
+
for (const edge of edges) {
|
|
162
|
+
const a = nodeMap.get(edge.from), b = nodeMap.get(edge.to);
|
|
163
|
+
if (!a || !b) continue;
|
|
164
|
+
const isCycleEdge = cycleNodeIds.has(edge.from) && cycleNodeIds.has(edge.to);
|
|
165
|
+
ctx.strokeStyle = isCycleEdge ? cssVar('--prof-mem-leak') : cssVar('--prof-border');
|
|
166
|
+
ctx.lineWidth = isCycleEdge ? 2 : 1;
|
|
167
|
+
ctx.beginPath();
|
|
168
|
+
ctx.moveTo(a.x, a.y);
|
|
169
|
+
ctx.lineTo(b.x, b.y);
|
|
170
|
+
ctx.stroke();
|
|
171
|
+
if (edge.label && !b.crowded) {
|
|
172
|
+
ctx.fillStyle = cssVar('--prof-text-secondary');
|
|
173
|
+
ctx.font = '9px monospace';
|
|
174
|
+
ctx.textAlign = 'left';
|
|
175
|
+
ctx.fillText(edge.label, (a.x + b.x) / 2 + 4, (a.y + b.y) / 2 - 4);
|
|
176
|
+
}
|
|
177
|
+
}`;
|
|
178
|
+
/** Nodes: targets, roots and cycles in the legend's colours; a root named by its label above its type. */
|
|
179
|
+
const REF_GRAPH_NODES_SCRIPT = `
|
|
180
|
+
for (const n of nodeMap.values()) {
|
|
181
|
+
const color = cssVar(n.isTarget ? '--prof-mem-critical' : n.isRoot ? '--prof-info' : cycleNodeIds.has(n.id) ? '--prof-mem-leak' : '--prof-text-secondary');
|
|
182
|
+
ctx.beginPath();
|
|
183
|
+
ctx.arc(n.x, n.y, n.radius, 0, Math.PI * 2);
|
|
184
|
+
ctx.fillStyle = color;
|
|
185
|
+
ctx.globalAlpha = 0.2;
|
|
186
|
+
ctx.fill();
|
|
187
|
+
ctx.globalAlpha = 1;
|
|
188
|
+
ctx.strokeStyle = color;
|
|
189
|
+
ctx.lineWidth = n.isTarget || n.isRoot ? 3 : 1.5;
|
|
190
|
+
ctx.stroke();
|
|
191
|
+
ctx.textAlign = 'center';
|
|
192
|
+
if (n.isRoot) {
|
|
193
|
+
ctx.fillStyle = color;
|
|
194
|
+
ctx.font = 'bold 13px monospace';
|
|
195
|
+
ctx.fillText(n.repr, n.x, n.y - n.radius - 10);
|
|
196
|
+
}
|
|
197
|
+
if (n.crowded) continue;
|
|
198
|
+
ctx.fillStyle = cssVar('--prof-text');
|
|
199
|
+
ctx.font = '10px monospace';
|
|
200
|
+
ctx.fillText(n.type, n.x, n.y + n.radius + 14);
|
|
201
|
+
ctx.fillStyle = cssVar('--prof-text-secondary');
|
|
202
|
+
ctx.font = '9px monospace';
|
|
203
|
+
ctx.fillText(formatBytes(n.size), n.x, n.y + n.radius + 26);
|
|
204
|
+
}`;
|
|
205
|
+
/** A crowded layer names its type once, with a count, and the drawing branch closes. */
|
|
206
|
+
const REF_GRAPH_LAYER_LABELS_SCRIPT = `
|
|
207
|
+
for (const [depth, members] of layers) {
|
|
208
|
+
const first = nodeMap.get(members[0].id);
|
|
209
|
+
if (!first.crowded) continue;
|
|
210
|
+
const types = new Set(members.map((n) => n.type));
|
|
211
|
+
ctx.fillStyle = cssVar('--prof-text');
|
|
212
|
+
ctx.font = '11px monospace';
|
|
213
|
+
ctx.textAlign = 'center';
|
|
214
|
+
ctx.fillText(members.length + ' × ' + (types.size === 1 ? members[0].type : 'objects'), W / 2, first.y + first.radius + 18);
|
|
215
|
+
}
|
|
216
|
+
}`;
|
|
217
|
+
/** The legend, in the colours the canvas draws. */
|
|
218
|
+
const REF_GRAPH_LEGEND_HTML = `
|
|
219
|
+
<div class="legend">
|
|
220
|
+
<div class="legend-item"><div class="legend-dot" style="background: var(--prof-mem-critical)"></div> Target object</div>
|
|
221
|
+
<div class="legend-item"><div class="legend-dot" style="background: var(--prof-info)"></div> GC root</div>
|
|
222
|
+
<div class="legend-item"><div class="legend-dot" style="background: var(--prof-text-secondary)"></div> Intermediate</div>
|
|
223
|
+
<div class="legend-item"><div class="legend-dot" style="background: var(--prof-mem-leak)"></div> Cycle member</div>
|
|
224
|
+
</div>`;
|
|
225
|
+
/** Build the complete retention-graph HTML (exported as an e2e seam). */
|
|
226
|
+
function buildRefGraphHtml(result) {
|
|
227
|
+
const escapedType = (0, profiler_styles_1.escapeHtml)(result.targetType);
|
|
228
|
+
return (0, profiler_webview_1.buildWebviewDocument)({
|
|
229
|
+
title: `Retention Graph — ${escapedType}`,
|
|
230
|
+
css: REF_GRAPH_CSS,
|
|
231
|
+
body: `
|
|
232
|
+
<h1><span class="accent">◉</span> Retention Graph — <span class="accent">${escapedType}</span></h1>
|
|
233
|
+
${buildRetentionPathHtml(result.graph?.retentionPath ?? [])}
|
|
234
|
+
<canvas id="graph" width="800" height="500"></canvas>${REF_GRAPH_LEGEND_HTML}`,
|
|
235
|
+
script: buildRefGraphScript(result),
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* The drawing script. Node types/reprs and edge labels are profiled-program
|
|
240
|
+
* data, embedded so they can never close the inline <script> ([PROF-UI-WEBVIEW]).
|
|
241
|
+
*/
|
|
242
|
+
function buildRefGraphScript(result) {
|
|
243
|
+
const { graph } = result;
|
|
244
|
+
return profiler_styles_1.PROFILER_JS_UTILS +
|
|
245
|
+
refGraphDataScript((0, profiler_webview_1.embedJson)(graph?.nodes ?? []), (0, profiler_webview_1.embedJson)(graph?.edges ?? []), (0, profiler_webview_1.embedJson)(graph?.cycles ?? [])) +
|
|
246
|
+
REF_GRAPH_LAYOUT_SCRIPT + REF_GRAPH_EDGES_SCRIPT + REF_GRAPH_NODES_SCRIPT + REF_GRAPH_LAYER_LABELS_SCRIPT;
|
|
247
|
+
}
|
|
248
|
+
//# sourceMappingURL=memory-ref-graph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-ref-graph.js","sourceRoot":"","sources":["../../src/memory-ref-graph.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The data-driven type picker for "Show Reference Graph".
|
|
3
|
+
*
|
|
4
|
+
* The walk needs the runtime's exact name for a type, so the candidates are the
|
|
5
|
+
* types the runtime itself reported in this session's latest snapshot, in the
|
|
6
|
+
* snapshot's order. They are never names guessed from source text or one
|
|
7
|
+
* language's builtins: another runtime names its types differently and the walk
|
|
8
|
+
* would find nothing ([PROF-INVARIANTS]). Free text stays one pick away for a
|
|
9
|
+
* type the snapshot did not list.
|
|
10
|
+
*/
|
|
11
|
+
import type { ProfilerStore as Store } from "./store";
|
|
12
|
+
import type { MemoryDashboardSnapshot } from "./memory-dashboard";
|
|
13
|
+
/** The distinct runtime-reported type names of `snapshot`'s allocation sites, in order. */
|
|
14
|
+
export declare function referenceTypeCandidates(snapshot: MemoryDashboardSnapshot | undefined): string[];
|
|
15
|
+
/**
|
|
16
|
+
* Offer the snapshot's types, returning the chosen one (or undefined when
|
|
17
|
+
* cancelled). With no snapshot types, or on "Other type…", ask in free text.
|
|
18
|
+
*/
|
|
19
|
+
export declare function pickReferenceType(): Promise<string | undefined>;
|
|
20
|
+
/** Run the reference-graph walk for `typeName` and open the graph webview. */
|
|
21
|
+
export declare function walkReferences(store: Store, typeName: string): Promise<void>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Implements [PROF-UI-REFGRAPH].
|
|
3
|
+
// See docs/specs/LSP-PROFILER-SPEC.md
|
|
4
|
+
/**
|
|
5
|
+
* The data-driven type picker for "Show Reference Graph".
|
|
6
|
+
*
|
|
7
|
+
* The walk needs the runtime's exact name for a type, so the candidates are the
|
|
8
|
+
* types the runtime itself reported in this session's latest snapshot, in the
|
|
9
|
+
* snapshot's order. They are never names guessed from source text or one
|
|
10
|
+
* language's builtins: another runtime names its types differently and the walk
|
|
11
|
+
* would find nothing ([PROF-INVARIANTS]). Free text stays one pick away for a
|
|
12
|
+
* type the snapshot did not list.
|
|
13
|
+
*/
|
|
14
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
17
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
18
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
19
|
+
}
|
|
20
|
+
Object.defineProperty(o, k2, desc);
|
|
21
|
+
}) : (function(o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
o[k2] = m[k];
|
|
24
|
+
}));
|
|
25
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
26
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
27
|
+
}) : function(o, v) {
|
|
28
|
+
o["default"] = v;
|
|
29
|
+
});
|
|
30
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
31
|
+
var ownKeys = function(o) {
|
|
32
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
33
|
+
var ar = [];
|
|
34
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
35
|
+
return ar;
|
|
36
|
+
};
|
|
37
|
+
return ownKeys(o);
|
|
38
|
+
};
|
|
39
|
+
return function (mod) {
|
|
40
|
+
if (mod && mod.__esModule) return mod;
|
|
41
|
+
var result = {};
|
|
42
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
43
|
+
__setModuleDefault(result, mod);
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
})();
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.referenceTypeCandidates = referenceTypeCandidates;
|
|
49
|
+
exports.pickReferenceType = pickReferenceType;
|
|
50
|
+
exports.walkReferences = walkReferences;
|
|
51
|
+
const vscode = __importStar(require("vscode"));
|
|
52
|
+
const memory_capture_1 = require("./memory-capture");
|
|
53
|
+
const memory_ref_graph_1 = require("./memory-ref-graph");
|
|
54
|
+
/** Reference-graph traversal bounds. */
|
|
55
|
+
const REF_GRAPH_MAX_DEPTH = 5;
|
|
56
|
+
const REF_GRAPH_MAX_NODES = 200;
|
|
57
|
+
/** The Quick Pick item that drops to free-text entry. */
|
|
58
|
+
const OTHER_TYPE_LABEL = "$(edit) Other type…";
|
|
59
|
+
/** The distinct runtime-reported type names of `snapshot`'s allocation sites, in order. */
|
|
60
|
+
function referenceTypeCandidates(snapshot) {
|
|
61
|
+
const names = (snapshot?.topAllocations ?? []).flatMap((site) => site.typeName === undefined ? [] : [site.typeName]);
|
|
62
|
+
return [...new Set(names)];
|
|
63
|
+
}
|
|
64
|
+
/** Ask for a type name in free text. */
|
|
65
|
+
async function askForTypeName() {
|
|
66
|
+
return vscode.window.showInputBox({
|
|
67
|
+
prompt: "Type to inspect, exactly as the runtime names it",
|
|
68
|
+
placeHolder: "Take a snapshot first to pick from the types it found",
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Offer the snapshot's types, returning the chosen one (or undefined when
|
|
73
|
+
* cancelled). With no snapshot types, or on "Other type…", ask in free text.
|
|
74
|
+
*/
|
|
75
|
+
async function pickReferenceType() {
|
|
76
|
+
const candidates = referenceTypeCandidates((0, memory_capture_1.lastMemorySnapshot)());
|
|
77
|
+
if (candidates.length === 0) {
|
|
78
|
+
return askForTypeName();
|
|
79
|
+
}
|
|
80
|
+
const pick = await vscode.window.showQuickPick([...candidates.map((type) => ({ label: type })), { label: OTHER_TYPE_LABEL }], { placeHolder: "Inspect retainers of which type? (types in the latest snapshot)", ignoreFocusOut: true });
|
|
81
|
+
if (pick === undefined) {
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
return pick.label === OTHER_TYPE_LABEL ? askForTypeName() : pick.label;
|
|
85
|
+
}
|
|
86
|
+
/** Run the reference-graph walk for `typeName` and open the graph webview. */
|
|
87
|
+
async function walkReferences(store, typeName) {
|
|
88
|
+
const result = await (0, memory_capture_1.runMemoryScript)(store, memory_capture_1.LSP_MEM_CMD.references, {
|
|
89
|
+
type_name: typeName,
|
|
90
|
+
max_depth: REF_GRAPH_MAX_DEPTH,
|
|
91
|
+
limit: REF_GRAPH_MAX_NODES,
|
|
92
|
+
});
|
|
93
|
+
if (result?.kind === "refs") {
|
|
94
|
+
(0, memory_ref_graph_1.openRefGraphWebview)({
|
|
95
|
+
targetType: typeName,
|
|
96
|
+
maxDepth: REF_GRAPH_MAX_DEPTH,
|
|
97
|
+
maxNodes: REF_GRAPH_MAX_NODES,
|
|
98
|
+
script: "",
|
|
99
|
+
graph: (0, memory_ref_graph_1.decodeRefGraph)(result.graph),
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=memory-ref-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-ref-picker.js","sourceRoot":"","sources":["../../src/memory-ref-picker.ts"],"names":[],"mappings":";AAAA,iCAAiC;AACjC,sCAAsC;AACtC;;;;;;;;;GASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,MAAY,MAAM,mCAAe;AAGjC,qDAAoF;AACpF,yDAAyE;AAEzE,wCAAwC;AACxC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEhC,yDAAyD;AACzD,MAAM,gBAAgB,GAAG,qBAAqB,CAAC;AAE/C,2FAA2F;AAC3F,iCAAwC,QAA6C;IACnF,MAAM,KAAK,GAAG,CAAC,QAAQ,EAAE,cAAc,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAC9D,IAAI,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CACnD,CAAC;IACF,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;AAC7B,CAAC;AAED,wCAAwC;AACxC,KAAK,UAAU,cAAc;IAC3B,OAAO,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;QAChC,MAAM,EAAE,kDAAkD;QAC1D,WAAW,EAAE,uDAAuD;KACrE,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACI,KAAK;IACV,MAAM,UAAU,GAAG,uBAAuB,CAAC,IAAA,mCAAkB,GAAE,CAAC,CAAC;IACjE,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAAC,OAAO,cAAc,EAAE,CAAC;IAAC,CAAC;IACzD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,aAAa,CAC5C,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC,EAC7E,EAAE,WAAW,EAAE,iEAAiE,EAAE,cAAc,EAAE,IAAI,EAAE,CACzG,CAAC;IACF,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QAAC,OAAO,SAAS,CAAC;IAAC,CAAC;IAC7C,OAAO,IAAI,CAAC,KAAK,KAAK,gBAAgB,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;AACzE,CAAC;AAED,8EAA8E;AACvE,KAAK,yBAAyB,KAAY,EAAE,QAAgB;IACjE,MAAM,MAAM,GAAG,MAAM,IAAA,gCAAe,EAAC,KAAK,EAAE,4BAAW,CAAC,UAAU,EAAE;QAClE,SAAS,EAAE,QAAQ;QACnB,SAAS,EAAE,mBAAmB;QAC9B,KAAK,EAAE,mBAAmB;KAC3B,CAAC,CAAC;IACH,IAAI,MAAM,EAAE,IAAI,KAAK,MAAM,EAAE,CAAC;QAC5B,IAAA,sCAAmB,EAAC;YAClB,UAAU,EAAE,QAAQ;YACpB,QAAQ,EAAE,mBAAmB;YAC7B,QAAQ,EAAE,mBAAmB;YAC7B,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,IAAA,iCAAc,EAAC,MAAM,CAAC,KAAK,CAAC;SACpC,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|