executionGraph.ts ×4

Frontier kind: Code frontier

unlabeled · c_8bbfd8b9a3c8

6 tests · 3512 LOC · 19 files · introduces 0 tests · 132 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
4 ranges132 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
485 ranges3512 lines · 19 files · Browse complete extent
All tests (intent)
6 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Introduced files, introduced tests, and structurally relevant concept specializationexecutionGraph.ts ×3 · 3 introduced LOCexecutionGraph.ts ×3executionGraph.ts ×1 · 29 introduced LOCexecutionGraph.ts ×1executionGraph.ts ×5 · 139 introduced LOCexecutionGraph.ts ×5executionGraph.ts ×6 · 102 introduced LOCexecutionGraph.ts ×6executionGraph.ts ×2 · 10 introduced LOCexecutionGraph.ts ×2uri.test|title=URI URI#file, win-speciale|occurrence=1, charCode.test|title=CharCode has good values|occurrence=1, +2 · 0 introduced LOCuri.test|title=URI URI#f…utils.ts ×3 · 9 introduced LOCutils.ts ×3lifecycle.ts ×2 · 4 introduced LOClifecycle.ts ×2lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1lifecycle.ts ×4 · 8 introduced LOClifecycle.ts ×4lifecycle.ts ×6 · 16 introduced LOClifecycle.ts ×6lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1lifecycle.ts ×1 · 3 introduced LOClifecycle.ts ×1map.ts ×97 · 3334 introduced LOCmap.ts ×97src/vs/base/common/arrays.ts · 949 LOCcommon/arrays.tssrc/vs/base/common/arraysFind.ts · 226 LOCcommon/arraysFind.tssrc/vs/base/common/assert.ts · 91 LOCcommon/assert.tssrc/vs/base/common/charCode.ts · 450 LOCcommon/charCode.tssrc/vs/base/common/collections.ts · 176 LOCcommon/collections.tssrc/vs/base/common/errors.ts · 357 LOCcommon/errors.tssrc/vs/base/common/functional.ts · 32 LOCcommon/functional.tssrc/vs/base/common/iterator.ts · 194 LOCcommon/iterator.tssrc/vs/base/common/lifecycle.ts · 974 LOCcommon/lifecycle.tssrc/vs/base/common/map.ts · 1016 LOCcommon/map.tssrc/vs/base/common/marshallingIds.ts · 33 LOCcommon/marshallingIds.tssrc/vs/base/common/path.ts · 1589 LOCcommon/path.tssrc/vs/base/common/platform.ts · 281 LOCcommon/platform.tssrc/vs/base/common/process.ts · 76 LOCcommon/process.tssrc/vs/base/common/types.ts · 410 LOCcommon/types.tssrc/vs/base/common/uri.ts · 754 LOCcommon/uri.tssrc/vs/base/test/common/executionGraph.ts · 543 LOCcommon/executionGraph.tssrc/vs/base/test/common/utils.ts · 107 LOCcommon/utils.tssrc/vs/nls.ts · 244 LOCvs/nls.tscharCode.test|title=CharCode has good values|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/charCode.test|title=CharCode has good values|occurrence=1charCode.test|title=Char…executionGraph.test|title=executionGraph renderLaneGraph: degenerate linked-list tree (5 nodes)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/executionGraph.test|title=executionGraph renderLaneGraph: degenerate linked-list tree (5 nodes)|occurrence=1executionGraph.test|titl…executionGraph.test|title=executionGraph renderLaneGraph: forest with forks across two roots|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/executionGraph.test|title=executionGraph renderLaneGraph: forest with forks across two roots|occurrence=1executionGraph.test|titl…executionGraph.test|title=executionGraph renderSwimlanes: degenerate linked-list tree (5 nodes)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/executionGraph.test|title=executionGraph renderSwimlanes: degenerate linked-list tree (5 nodes)|occurrence=1executionGraph.test|titl…executionGraph.test|title=executionGraph renderSwimlanes: empty history|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/executionGraph.test|title=executionGraph renderSwimlanes: empty history|occurrence=1executionGraph.test|titl…executionGraph.test|title=executionGraph renderSwimlanes: forest with forks across two roots|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/executionGraph.test|title=executionGraph renderSwimlanes: forest with forks across two roots|occurrence=1executionGraph.test|titl…executionGraph.test|title=executionGraph renderSwimlanes: single root, linear chain|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/executionGraph.test|title=executionGraph renderSwimlanes: single root, linear chain|occurrence=1executionGraph.test|titl…path.test|title=Paths (Node Implementation) path|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/path.test|title=Paths (Node Implementation) path|occurrence=1path.test|title=Paths (N…uri.test|title=URI File paths containing apostrophes break URI parsing and cannot be opened #276075|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI File paths containing apostrophes break URI parsing and cannot be opened #276075|occurrence=1uri.test|title=URI File …uri.test|title=URI URI#file, win-speciale|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI URI#file, win-speciale|occurrence=1uri.test|title=URI URI#f…Focused concept · executionGraph.ts ×4 · 132 introduced LOCexecutionGraph.ts ×4

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 132 introduced LOC across 4 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/base/test/common/executionGraph.ts 132 introduced LOC · 4 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- executionGraph.ts
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > /**
7 > * Plain, renderer-friendly description of an execution history produced by a
8 > * traced scheduler. These types have no dependency on the tracing or
9 > * scheduling implementation — they can be built by hand in tests or by the
10 > * `buildHistoryFromTasks` adapter below.
11 > */
12 >
13 > export interface ExecutionRoot {
14 > readonly label: string;
15 > }
16 >
17 > export interface ExecutionEvent {
18 > /** Relative time (e.g. ms since startTime). Must be >= 0 and non-decreasing in history order. */
19 > readonly time: number;
20 > readonly label: string;
21 > readonly root: ExecutionRoot;
22 > /** `undefined` means this event is a direct child of its root. */
23 > readonly parent: ExecutionEvent | undefined;
24 > /** Caller frame extracted from the scheduling stack trace. */
25 > readonly detail?: string;
26 > }
27 >
28 > export interface ExecutionHistory {
29 > /** Roots in first-appearance order (column order for renderers). */
30 > readonly roots: readonly ExecutionRoot[];
31 > /** Events in time order. */
32 > readonly events: readonly ExecutionEvent[];
33 > }
34 >
35 > // -----------------------------------------------------------------------------
36 > // Adapter: ScheduledTask[] -> ExecutionHistory
37 > // -----------------------------------------------------------------------------
38 >
39 > interface TraceLike {
40 > readonly parent: TraceLike | undefined;
41 > readonly root: { readonly label: string };
42 > }
43 >
44 > interface ScheduledTaskLike {
45 > readonly time: number;
46 > readonly source: { toString(): string; readonly stackTrace?: string };
47 > readonly trace?: TraceLike;
48 > }
49 >
50 > /**
51 > * A log entry to weave into the history alongside scheduled tasks. Each log is
52 > * tagged with the trace that was current when it was emitted.
53 > */
54 > export interface LogEntryLike {
55 > readonly trace: TraceLike;
56 > readonly message: string;
57 > }
58 >
59 > /**
60 > * Convert a list of scheduled tasks (each carrying a causal `trace`) into a
61 > * plain `ExecutionHistory`. Untraced tasks are dropped. A task's parent event
62 > * is the most recent earlier task whose `trace` is `task.trace.parent`; if
63 > * `task.trace.parent` is the trace root itself, the event has no parent event
64 > * (it is a direct child of the root).
65 > *
66 > * `logs` (if given) are interleaved as synthetic events: each log's parent is
67 > * the task event whose trace matches the log's current trace at emission
68 > * time (or the nearest ancestor task event), and its time is inherited from
69 > * that parent. Within a single parent task, logs are kept in emission order
70 > * and inserted directly after the parent event.
71 > */
72 > export function buildHistoryFromTasks(
73 tasks: readonly ScheduledTaskLike[],
74 startTime: number,
143 return { roots, events };
144 }
146 > /**
147 > * Extract up to {@link MAX_DETAIL_FRAMES} stack frames that are not from
148 > * the scheduler/tracing infrastructure. Returns the frames joined by
149 > * newline (callers may render them stacked) or `undefined` when none.
150 > */
151 > const _skipFramePatterns = [
152 > /[\\/]virtualScheduling[\\/]/,
153 > /[\\/]vs[\\/]base[\\/]common[\\/]async\./,
154 > /timeTravelScheduler|traceableTimeApi/,
155 > /RunOnceScheduler\.schedule/,
156 > /scheduleAtNextAnimationFrame/,
157 > /TimeoutTimer\.cancelAndSet/,
158 > /TimeoutTimer\.setIfNotSet/,
159 > /timeoutDeferred/,
160 > /createTimeout/,
161 > ];
162 >
163 > const MAX_DETAIL_FRAMES = 5;
164 >
165 function extractCallerFrame(stackTrace: string | undefined): string | undefined {
166 if (!stackTrace) { return undefined; }
175 return frames.length === 0 ? undefined : frames.join('\n');
176 }
178 > // -----------------------------------------------------------------------------
179 > // Renderer: swimlane (one column per root)
180 > // -----------------------------------------------------------------------------
181 >
182 > /**
183 > * Render `history` as a swimlane diagram: one column per root, events in the
184 > * column of their root, parent→child shown via `├─`/`└─` indentation, active
185 > * ancestors shown via `│` continuation lines.
186 > *
187 > * Example:
188 > * ```
189 > * A B
190 > * +0ms ├─ setTimeout
191 > * +10ms │ ├─ setTimeout
192 > * +16ms ├─ rAF │
193 > * +50ms └─ setTimeout
194 > * ```
195 > */
196 > export function renderSwimlanes(history: ExecutionHistory): string {
197 const { roots, events } = history;
198 if (events.length === 0) { return '(empty history)'; }
414 return lines.join('\n');
415 }
417 > // -----------------------------------------------------------------------------
418 > // Renderer: interleaved lane graph (git-log style)
419 > // -----------------------------------------------------------------------------
420 >
421 > /**
422 > * Render `history` as an interleaved-lane "git log" style graph. Each parent
423 > * event gets a column; columns are laid out left-to-right in event order.
424 > * Trace roots with at least one direct child become synthetic `+label` rows
425 > * inserted before their first child.
426 > *
427 > * Glyphs:
428 > * `╷` lane origin (this node is a parent)
429 > * `│` lane passes through
430 > * `├─` child connects; lane continues
431 > * `└─` last child connects; lane closes
432 > * `┼─` horizontal connector crosses an active lane
433 > * `──` horizontal connector crosses an empty column
434 > */
435 > export function renderLaneGraph(history: ExecutionHistory): string {
436 const { events } = history;
437 if (events.length === 0) { return ''; }