@paulirish/trace_engine 0.0.32 → 0.0.34
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/.tmp/tsbuildinfo/analyze-trace.d.mts +18 -0
- package/.tmp/tsbuildinfo/analyze-trace.d.mts.map +1 -0
- package/.tmp/tsbuildinfo/models/trace/LanternComputationData.d.ts +46 -0
- package/.tmp/tsbuildinfo/models/trace/LanternComputationData.d.ts.map +1 -0
- package/.tmp/tsbuildinfo/models/trace/LegacyTracingModel.d.ts +2 -0
- package/.tmp/tsbuildinfo/models/trace/LegacyTracingModel.d.ts.map +1 -0
- package/.tmp/tsbuildinfo/models/trace/ModelImpl.d.ts +72 -0
- package/.tmp/tsbuildinfo/models/trace/ModelImpl.d.ts.map +1 -0
- package/.tmp/tsbuildinfo/models/trace/Processor.d.ts +25 -0
- package/.tmp/tsbuildinfo/models/trace/Processor.d.ts.map +1 -0
- package/.tmp/tsbuildinfo/models/trace/TracingManager.d.ts +2 -0
- package/.tmp/tsbuildinfo/models/trace/TracingManager.d.ts.map +1 -0
- package/.tmp/tsbuildinfo/models/trace/trace.d.ts +13 -0
- package/.tmp/tsbuildinfo/models/trace/trace.d.ts.map +1 -0
- package/.tmp/tsbuildinfo/test/test-trace-engine.d.mts +2 -0
- package/.tmp/tsbuildinfo/test/test-trace-engine.d.mts.map +1 -0
- package/.tmp/tsbuildinfo/third_party/third-party-web/third-party-web.d.ts +3 -0
- package/.tmp/tsbuildinfo/third_party/third-party-web/third-party-web.d.ts.map +1 -0
- package/.tmp/tsbuildinfo/tsconfig.tsbuildinfo +1 -0
- package/README.md +6 -10
- package/analyze-trace.mjs +51 -16
- package/core/platform/ArrayUtilities.js +1 -0
- package/core/platform/ArrayUtilities.js.map +1 -1
- package/core/platform/DevToolsPath.d.ts +1 -1
- package/core/platform/DevToolsPath.js.map +1 -1
- package/core/platform/MimeType.js +4 -2
- package/core/platform/MimeType.js.map +1 -1
- package/core/platform/NumberUtilities.js +8 -0
- package/core/platform/NumberUtilities.js.map +1 -1
- package/core/platform/ServerTiming.d.ts +31 -0
- package/core/platform/ServerTiming.js +212 -0
- package/core/platform/ServerTiming.js.map +1 -0
- package/core/platform/Timing.d.ts +1 -1
- package/core/platform/Timing.js.map +1 -1
- package/core/platform/TypescriptUtilities.d.ts +3 -0
- package/core/platform/TypescriptUtilities.js.map +1 -1
- package/core/platform/UIString.d.ts +1 -1
- package/core/platform/UIString.js.map +1 -1
- package/core/platform/UserVisibleError.d.ts +1 -1
- package/core/platform/UserVisibleError.js.map +1 -1
- package/core/platform/platform-tsconfig.json +1 -1
- package/core/platform/platform.d.ts +2 -2
- package/core/platform/platform.js +2 -2
- package/core/platform/platform.js.map +1 -1
- package/generated/protocol.d.ts +289 -16
- package/models/trace/LanternComputationData.d.ts +4 -4
- package/models/trace/LanternComputationData.js +22 -23
- package/models/trace/LanternComputationData.js.map +1 -1
- package/models/trace/ModelImpl.d.ts +11 -12
- package/models/trace/ModelImpl.js +22 -33
- package/models/trace/ModelImpl.js.map +1 -1
- package/models/trace/Processor.d.ts +21 -12
- package/models/trace/Processor.js +151 -67
- package/models/trace/Processor.js.map +1 -1
- package/models/trace/TracingManager.js.map +1 -1
- package/models/trace/extras/FetchNodes.d.ts +8 -8
- package/models/trace/extras/FetchNodes.js +16 -11
- package/models/trace/extras/FetchNodes.js.map +1 -1
- package/models/trace/extras/FilmStrip.d.ts +2 -2
- package/models/trace/extras/FilmStrip.js +8 -8
- package/models/trace/extras/FilmStrip.js.map +1 -1
- package/models/trace/extras/MainThreadActivity.d.ts +1 -1
- package/models/trace/extras/MainThreadActivity.js +1 -1
- package/models/trace/extras/MainThreadActivity.js.map +1 -1
- package/models/trace/extras/Metadata.js +2 -2
- package/models/trace/extras/Metadata.js.map +1 -1
- package/models/trace/extras/ThirdParties.d.ts +23 -0
- package/models/trace/extras/ThirdParties.js +152 -0
- package/models/trace/extras/ThirdParties.js.map +1 -0
- package/models/trace/extras/URLForEntry.d.ts +9 -1
- package/models/trace/extras/URLForEntry.js +18 -10
- package/models/trace/extras/URLForEntry.js.map +1 -1
- package/models/trace/extras/extras-tsconfig.json +1 -0
- package/models/trace/extras/extras.d.ts +4 -1
- package/models/trace/extras/extras.js +4 -1
- package/models/trace/extras/extras.js.map +1 -1
- package/models/trace/handlers/AnimationHandler.d.ts +2 -2
- package/models/trace/handlers/AnimationHandler.js +1 -1
- package/models/trace/handlers/AnimationHandler.js.map +1 -1
- package/models/trace/handlers/AuctionWorkletsHandler.d.ts +2 -2
- package/models/trace/handlers/AuctionWorkletsHandler.js +11 -11
- package/models/trace/handlers/AuctionWorkletsHandler.js.map +1 -1
- package/models/trace/handlers/ExtensionTraceDataHandler.d.ts +6 -6
- package/models/trace/handlers/ExtensionTraceDataHandler.js +12 -8
- package/models/trace/handlers/ExtensionTraceDataHandler.js.map +1 -1
- package/models/trace/handlers/FramesHandler.d.ts +34 -22
- package/models/trace/handlers/FramesHandler.js +54 -26
- package/models/trace/handlers/FramesHandler.js.map +1 -1
- package/models/trace/handlers/GPUHandler.d.ts +4 -4
- package/models/trace/handlers/GPUHandler.js +3 -3
- package/models/trace/handlers/GPUHandler.js.map +1 -1
- package/models/trace/handlers/ImagePaintingHandler.d.ts +3 -3
- package/models/trace/handlers/ImagePaintingHandler.js +6 -8
- package/models/trace/handlers/ImagePaintingHandler.js.map +1 -1
- package/models/trace/handlers/InitiatorsHandler.d.ts +3 -3
- package/models/trace/handlers/InitiatorsHandler.js +25 -14
- package/models/trace/handlers/InitiatorsHandler.js.map +1 -1
- package/models/trace/handlers/InvalidationsHandler.d.ts +4 -2
- package/models/trace/handlers/InvalidationsHandler.js +29 -11
- package/models/trace/handlers/InvalidationsHandler.js.map +1 -1
- package/models/trace/handlers/LargestImagePaintHandler.d.ts +2 -2
- package/models/trace/handlers/LargestImagePaintHandler.js +1 -1
- package/models/trace/handlers/LargestImagePaintHandler.js.map +1 -1
- package/models/trace/handlers/LargestTextPaintHandler.d.ts +2 -2
- package/models/trace/handlers/LargestTextPaintHandler.js +1 -1
- package/models/trace/handlers/LargestTextPaintHandler.js.map +1 -1
- package/models/trace/handlers/LayerTreeHandler.d.ts +6 -6
- package/models/trace/handlers/LayerTreeHandler.js +6 -6
- package/models/trace/handlers/LayerTreeHandler.js.map +1 -1
- package/models/trace/handlers/LayoutShiftsHandler.d.ts +14 -20
- package/models/trace/handlers/LayoutShiftsHandler.js +87 -12
- package/models/trace/handlers/LayoutShiftsHandler.js.map +1 -1
- package/models/trace/handlers/MemoryHandler.d.ts +2 -2
- package/models/trace/handlers/MemoryHandler.js +1 -1
- package/models/trace/handlers/MemoryHandler.js.map +1 -1
- package/models/trace/handlers/MetaHandler.d.ts +15 -14
- package/models/trace/handlers/MetaHandler.js +32 -30
- package/models/trace/handlers/MetaHandler.js.map +1 -1
- package/models/trace/handlers/ModelHandlers.d.ts +1 -1
- package/models/trace/handlers/ModelHandlers.js +1 -1
- package/models/trace/handlers/ModelHandlers.js.map +1 -1
- package/models/trace/handlers/NetworkRequestsHandler.d.ts +13 -12
- package/models/trace/handlers/NetworkRequestsHandler.js +68 -66
- package/models/trace/handlers/NetworkRequestsHandler.js.map +1 -1
- package/models/trace/handlers/PageFramesHandler.d.ts +2 -2
- package/models/trace/handlers/PageFramesHandler.js +2 -2
- package/models/trace/handlers/PageFramesHandler.js.map +1 -1
- package/models/trace/handlers/PageLoadMetricsHandler.d.ts +7 -7
- package/models/trace/handlers/PageLoadMetricsHandler.js +21 -24
- package/models/trace/handlers/PageLoadMetricsHandler.js.map +1 -1
- package/models/trace/handlers/RendererHandler.d.ts +19 -19
- package/models/trace/handlers/RendererHandler.js +5 -5
- package/models/trace/handlers/RendererHandler.js.map +1 -1
- package/models/trace/handlers/SamplesHandler.d.ts +6 -6
- package/models/trace/handlers/SamplesHandler.js +3 -3
- package/models/trace/handlers/SamplesHandler.js.map +1 -1
- package/models/trace/handlers/ScreenshotsHandler.d.ts +6 -4
- package/models/trace/handlers/ScreenshotsHandler.js +11 -9
- package/models/trace/handlers/ScreenshotsHandler.js.map +1 -1
- package/models/trace/handlers/SelectorStatsHandler.d.ts +3 -3
- package/models/trace/handlers/SelectorStatsHandler.js +2 -2
- package/models/trace/handlers/SelectorStatsHandler.js.map +1 -1
- package/models/trace/handlers/ServerTimingsHandler.d.ts +10 -0
- package/models/trace/handlers/ServerTimingsHandler.js +118 -0
- package/models/trace/handlers/ServerTimingsHandler.js.map +1 -0
- package/models/trace/handlers/Threads.d.ts +7 -7
- package/models/trace/handlers/Threads.js +5 -5
- package/models/trace/handlers/Threads.js.map +1 -1
- package/models/trace/handlers/UserInteractionsHandler.d.ts +13 -11
- package/models/trace/handlers/UserInteractionsHandler.js +13 -7
- package/models/trace/handlers/UserInteractionsHandler.js.map +1 -1
- package/models/trace/handlers/UserTimingsHandler.d.ts +5 -5
- package/models/trace/handlers/UserTimingsHandler.js +52 -9
- package/models/trace/handlers/UserTimingsHandler.js.map +1 -1
- package/models/trace/handlers/WarningsHandler.d.ts +5 -5
- package/models/trace/handlers/WarningsHandler.js +4 -5
- package/models/trace/handlers/WarningsHandler.js.map +1 -1
- package/models/trace/handlers/WorkersHandler.d.ts +4 -4
- package/models/trace/handlers/WorkersHandler.js +1 -1
- package/models/trace/handlers/WorkersHandler.js.map +1 -1
- package/models/trace/handlers/handlers-tsconfig.json +1 -1
- package/models/trace/handlers/types.d.ts +7 -7
- package/models/trace/handlers/types.js.map +1 -1
- package/models/trace/helpers/Extensions.d.ts +2 -2
- package/models/trace/helpers/Extensions.js.map +1 -1
- package/models/trace/helpers/Network.d.ts +2 -2
- package/models/trace/helpers/Network.js +19 -2
- package/models/trace/helpers/Network.js.map +1 -1
- package/models/trace/helpers/SamplesIntegrator.d.ts +5 -5
- package/models/trace/helpers/SamplesIntegrator.js +10 -11
- package/models/trace/helpers/SamplesIntegrator.js.map +1 -1
- package/models/trace/helpers/SyntheticEvents.d.ts +8 -14
- package/models/trace/helpers/SyntheticEvents.js +20 -31
- package/models/trace/helpers/SyntheticEvents.js.map +1 -1
- package/models/trace/helpers/Timing.d.ts +18 -4
- package/models/trace/helpers/Timing.js +43 -1
- package/models/trace/helpers/Timing.js.map +1 -1
- package/models/trace/helpers/Trace.d.ts +46 -32
- package/models/trace/helpers/Trace.js +53 -24
- package/models/trace/helpers/Trace.js.map +1 -1
- package/models/trace/helpers/TreeHelpers.d.ts +40 -8
- package/models/trace/helpers/TreeHelpers.js +147 -19
- package/models/trace/helpers/TreeHelpers.js.map +1 -1
- package/models/trace/helpers/helpers-tsconfig.json +3 -0
- package/models/trace/insights/Common.d.ts +4 -3
- package/models/trace/insights/Common.js +22 -7
- package/models/trace/insights/Common.js.map +1 -1
- package/models/trace/insights/CumulativeLayoutShift.d.ts +36 -13
- package/models/trace/insights/CumulativeLayoutShift.js +199 -73
- package/models/trace/insights/CumulativeLayoutShift.js.map +1 -1
- package/models/trace/insights/DocumentLatency.d.ts +9 -4
- package/models/trace/insights/DocumentLatency.js +82 -7
- package/models/trace/insights/DocumentLatency.js.map +1 -1
- package/models/trace/insights/FontDisplay.d.ts +11 -0
- package/models/trace/insights/FontDisplay.js +44 -0
- package/models/trace/insights/FontDisplay.js.map +1 -0
- package/models/trace/insights/InsightRunners.d.ts +3 -0
- package/models/trace/insights/InsightRunners.js +3 -0
- package/models/trace/insights/InsightRunners.js.map +1 -1
- package/models/trace/insights/InteractionToNextPaint.d.ts +4 -5
- package/models/trace/insights/InteractionToNextPaint.js +5 -3
- package/models/trace/insights/InteractionToNextPaint.js.map +1 -1
- package/models/trace/insights/LargestContentfulPaint.d.ts +20 -7
- package/models/trace/insights/LargestContentfulPaint.js +57 -37
- package/models/trace/insights/LargestContentfulPaint.js.map +1 -1
- package/models/trace/insights/RenderBlocking.d.ts +3 -3
- package/models/trace/insights/RenderBlocking.js +29 -24
- package/models/trace/insights/RenderBlocking.js.map +1 -1
- package/models/trace/insights/SlowCSSSelector.d.ts +11 -0
- package/models/trace/insights/SlowCSSSelector.js +67 -0
- package/models/trace/insights/SlowCSSSelector.js.map +1 -0
- package/models/trace/insights/ThirdPartyWeb.d.ts +13 -0
- package/models/trace/insights/ThirdPartyWeb.js +42 -0
- package/models/trace/insights/ThirdPartyWeb.js.map +1 -0
- package/models/trace/insights/Viewport.d.ts +5 -2
- package/models/trace/insights/Viewport.js +14 -9
- package/models/trace/insights/Viewport.js.map +1 -1
- package/models/trace/insights/insights-tsconfig.json +9 -0
- package/models/trace/insights/insights.d.ts +1 -0
- package/models/trace/insights/insights.js +1 -0
- package/models/trace/insights/insights.js.map +1 -1
- package/models/trace/insights/types.d.ts +43 -25
- package/models/trace/insights/types.js.map +1 -1
- package/models/trace/lantern/core/NetworkAnalyzer.d.ts +9 -9
- package/models/trace/lantern/core/NetworkAnalyzer.js +18 -15
- package/models/trace/lantern/core/NetworkAnalyzer.js.map +1 -1
- package/models/trace/lantern/graph/BaseNode.d.ts +4 -4
- package/models/trace/lantern/graph/BaseNode.js +21 -21
- package/models/trace/lantern/graph/BaseNode.js.map +1 -1
- package/models/trace/lantern/graph/CPUNode.d.ts +1 -1
- package/models/trace/lantern/graph/CPUNode.js +5 -5
- package/models/trace/lantern/graph/CPUNode.js.map +1 -1
- package/models/trace/lantern/graph/PageDependencyGraph.d.ts +4 -4
- package/models/trace/lantern/graph/PageDependencyGraph.js +5 -5
- package/models/trace/lantern/graph/PageDependencyGraph.js.map +1 -1
- package/models/trace/lantern/simulation/ConnectionPool.d.ts +7 -7
- package/models/trace/lantern/simulation/ConnectionPool.js +26 -26
- package/models/trace/lantern/simulation/ConnectionPool.js.map +1 -1
- package/models/trace/lantern/simulation/DNSCache.d.ts +3 -3
- package/models/trace/lantern/simulation/DNSCache.js +11 -11
- package/models/trace/lantern/simulation/DNSCache.js.map +1 -1
- package/models/trace/lantern/simulation/SimulationTimingMap.d.ts +1 -1
- package/models/trace/lantern/simulation/SimulationTimingMap.js +15 -15
- package/models/trace/lantern/simulation/SimulationTimingMap.js.map +1 -1
- package/models/trace/lantern/simulation/Simulator.d.ts +28 -28
- package/models/trace/lantern/simulation/Simulator.js +113 -113
- package/models/trace/lantern/simulation/Simulator.js.map +1 -1
- package/models/trace/lantern/simulation/TCPConnection.d.ts +9 -9
- package/models/trace/lantern/simulation/TCPConnection.js +36 -36
- package/models/trace/lantern/simulation/TCPConnection.js.map +1 -1
- package/models/trace/root-causes/LayoutShift.d.ts +13 -13
- package/models/trace/root-causes/LayoutShift.js +7 -25
- package/models/trace/root-causes/LayoutShift.js.map +1 -1
- package/models/trace/types/Configuration.d.ts +16 -0
- package/models/trace/types/Configuration.js +1 -0
- package/models/trace/types/Configuration.js.map +1 -1
- package/models/trace/types/Extensions.d.ts +9 -12
- package/models/trace/types/Extensions.js +2 -1
- package/models/trace/types/Extensions.js.map +1 -1
- package/models/trace/types/File.d.ts +55 -23
- package/models/trace/types/File.js +15 -3
- package/models/trace/types/File.js.map +1 -1
- package/models/trace/types/TraceEvents.d.ts +868 -713
- package/models/trace/types/TraceEvents.js +281 -276
- package/models/trace/types/TraceEvents.js.map +1 -1
- package/models/trace/types/types.d.ts +1 -1
- package/models/trace/types/types.js +1 -1
- package/models/trace/types/types.js.map +1 -1
- package/package.json +10 -4
- package/test/test-trace-engine.mjs +56 -3
- package/third_party/third-party-web/third-party-web.js +1 -0
- package/tsconfig.json +29 -0
- package/core/platform/PromiseUtilities.d.ts +0 -10
- package/core/platform/PromiseUtilities.js +0 -18
- package/core/platform/PromiseUtilities.js.map +0 -1
- package/core/platform/SetUtilities.d.ts +0 -2
- package/core/platform/SetUtilities.js +0 -23
- package/core/platform/SetUtilities.js.map +0 -1
- package/models/trace/EntriesFilter.d.ts +0 -72
- package/models/trace/EntriesFilter.js +0 -296
- package/models/trace/EntriesFilter.js.map +0 -1
- package/models/trace/LegacyTracingModel.js.map +0 -1
- package/models/trace/handlers/EnhancedTracesHandler.d.ts +0 -48
- package/models/trace/handlers/EnhancedTracesHandler.js +0 -165
- package/models/trace/handlers/EnhancedTracesHandler.js.map +0 -1
- package/models/trace/lantern/BaseNode.d.ts +0 -91
- package/models/trace/lantern/BaseNode.js +0 -268
- package/models/trace/lantern/BaseNode.js.map +0 -1
- package/models/trace/lantern/CPUNode.d.ts +0 -24
- package/models/trace/lantern/CPUNode.js +0 -64
- package/models/trace/lantern/CPUNode.js.map +0 -1
- package/models/trace/lantern/LanternError.d.ts +0 -3
- package/models/trace/lantern/LanternError.js +0 -7
- package/models/trace/lantern/LanternError.js.map +0 -1
- package/models/trace/lantern/MetricsModule.d.ts +0 -11
- package/models/trace/lantern/MetricsModule.js +0 -14
- package/models/trace/lantern/MetricsModule.js.map +0 -1
- package/models/trace/lantern/NetworkNode.d.ts +0 -22
- package/models/trace/lantern/NetworkNode.js +0 -83
- package/models/trace/lantern/NetworkNode.js.map +0 -1
- package/models/trace/lantern/PageDependencyGraph.d.ts +0 -43
- package/models/trace/lantern/PageDependencyGraph.js +0 -509
- package/models/trace/lantern/PageDependencyGraph.js.map +0 -1
- package/models/trace/lantern/SimulationModule.d.ts +0 -17
- package/models/trace/lantern/SimulationModule.js +0 -13
- package/models/trace/lantern/SimulationModule.js.map +0 -1
- package/models/trace/lantern/simulation/NetworkAnalyzer.d.ts +0 -112
- package/models/trace/lantern/simulation/NetworkAnalyzer.js +0 -486
- package/models/trace/lantern/simulation/NetworkAnalyzer.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Configuration.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/Configuration.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;
|
|
1
|
+
{"version":3,"file":"Configuration.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/Configuration.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAiC7B,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAkB,EAAE,CAAC,CAAC;IAC5C,uBAAuB,EAAE,KAAK;IAC9B,aAAa,EAAE,KAAK;IACpB,SAAS,EAAE,KAAK;IAChB,6BAA6B,EAAE,EAAE;CAClC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAqB;IACpD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexport type Configuration = {\n /**\n * Include V8 RCS functions in the JS stacks\n */\n includeRuntimeCallStats: boolean,\n /**\n * Show all events: disable the default filtering which hides and excludes some events.\n */\n showAllEvents: boolean,\n /**\n * Extra detail for RPP developers (eg Trace Event json in Summary, and individual JS Sample events)\n */\n debugMode: boolean,\n /**\n * How many invalidation events will be stored for a layout (or similar) event.\n * On large sites with a lot of DOM there can be thousands of invalidations\n * associated with any given event. It is not useful to show the user 1000s of\n * invalidations in the UI, but it is also expensive for us to hold onto them\n * all, and it helps prevents OOM issues when running in NodeJS\n * [https://github.com/GoogleChrome/lighthouse/issues/16111].\n * Therefore, instead, we store only the latest 20 per event. We do also store\n * the total count, so we can show that, but we'll only ever hold on to the\n * last 20 invalidations (in DESC trace order - so the latest 20 in the trace file)\n *\n * If you set this to 0, we will skip the Invalidations processing entirely.\n * 0 effectively disables the InvalidationsHandler and it will not even\n * attempt to gather or track invalidations.\n */\n maxInvalidationEventsPerEvent: number,\n};\n\nexport const defaults = (): Configuration => ({\n includeRuntimeCallStats: false,\n showAllEvents: false,\n debugMode: false,\n maxInvalidationEventsPerEvent: 20,\n});\n\n/**\n * Generates a key that can be used to represent this config in a cache. This is\n * used mainly in tests, where we want to avoid re-parsing a file if we have\n * already processed it with the same configuration.\n */\nexport function configToCacheKey(config: Configuration): string {\n return JSON.stringify(config);\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Args, Event, Phase, SyntheticBased } from './TraceEvents.js';
|
|
2
2
|
export type ExtensionEntryType = 'track-entry' | 'marker';
|
|
3
|
-
declare const extensionPalette: readonly ["primary", "primary-light", "primary-dark", "secondary", "secondary-light", "secondary-dark", "tertiary", "tertiary-light", "tertiary-dark", "error"];
|
|
3
|
+
export declare const extensionPalette: readonly ["primary", "primary-light", "primary-dark", "secondary", "secondary-light", "secondary-dark", "tertiary", "tertiary-light", "tertiary-dark", "error", "warning"];
|
|
4
4
|
export type ExtensionColorFromPalette = typeof extensionPalette[number];
|
|
5
5
|
export declare function colorIsValid(color: string): boolean;
|
|
6
6
|
export interface ExtensionDataPayloadBase {
|
|
@@ -20,18 +20,16 @@ export interface ExtensionMarkerPayload extends ExtensionDataPayloadBase {
|
|
|
20
20
|
/**
|
|
21
21
|
* Synthetic events created for extension tracks.
|
|
22
22
|
*/
|
|
23
|
-
export interface
|
|
24
|
-
args:
|
|
25
|
-
cat: 'devtools.extension';
|
|
23
|
+
export interface SyntheticExtensionTrackEntry extends SyntheticBased<Phase.COMPLETE> {
|
|
24
|
+
args: Args & ExtensionTrackEntryPayload;
|
|
26
25
|
}
|
|
27
26
|
/**
|
|
28
27
|
* Synthetic events created for extension marks.
|
|
29
28
|
*/
|
|
30
|
-
export interface SyntheticExtensionMarker extends
|
|
31
|
-
args:
|
|
32
|
-
cat: 'devtools.extension';
|
|
29
|
+
export interface SyntheticExtensionMarker extends SyntheticBased<Phase.COMPLETE> {
|
|
30
|
+
args: Args & ExtensionMarkerPayload;
|
|
33
31
|
}
|
|
34
|
-
export type SyntheticExtensionEntry =
|
|
32
|
+
export type SyntheticExtensionEntry = SyntheticExtensionTrackEntry | SyntheticExtensionMarker;
|
|
35
33
|
export declare function isExtensionPayloadMarker(payload: {
|
|
36
34
|
dataType?: string;
|
|
37
35
|
}): payload is ExtensionMarkerPayload;
|
|
@@ -43,12 +41,11 @@ export declare function isValidExtensionPayload(payload: {
|
|
|
43
41
|
track?: string;
|
|
44
42
|
dataType?: string;
|
|
45
43
|
}): payload is ExtensionDataPayload;
|
|
46
|
-
export declare function isSyntheticExtensionEntry(entry:
|
|
44
|
+
export declare function isSyntheticExtensionEntry(entry: Event): entry is SyntheticExtensionEntry;
|
|
47
45
|
export interface ExtensionTrackData {
|
|
48
46
|
name: string;
|
|
49
47
|
isTrackGroup: boolean;
|
|
50
48
|
entriesByTrack: {
|
|
51
|
-
[x: string]:
|
|
49
|
+
[x: string]: SyntheticExtensionTrackEntry[];
|
|
52
50
|
};
|
|
53
51
|
}
|
|
54
|
-
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright 2024 The Chromium Authors. All rights reserved.
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
|
-
const extensionPalette = [
|
|
4
|
+
export const extensionPalette = [
|
|
5
5
|
'primary',
|
|
6
6
|
'primary-light',
|
|
7
7
|
'primary-dark',
|
|
@@ -12,6 +12,7 @@ const extensionPalette = [
|
|
|
12
12
|
'tertiary-light',
|
|
13
13
|
'tertiary-dark',
|
|
14
14
|
'error',
|
|
15
|
+
'warning',
|
|
15
16
|
];
|
|
16
17
|
export function colorIsValid(color) {
|
|
17
18
|
return extensionPalette.includes(color);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Extensions.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/Extensions.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;
|
|
1
|
+
{"version":3,"file":"Extensions.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/Extensions.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAM7B,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,SAAS;IACT,eAAe;IACf,cAAc;IACd,WAAW;IACX,iBAAiB;IACjB,gBAAgB;IAChB,UAAU;IACV,gBAAgB;IAChB,eAAe;IACf,OAAO;IACP,SAAS;CACD,CAAC;AAIX,MAAM,UAAU,YAAY,CAAC,KAAa;IACxC,OAAQ,gBAAsC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACjE,CAAC;AA8CD,MAAM,UAAU,wBAAwB,CAAC,OAA4B;IACnE,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,OAA4C;IAEvF,MAAM,QAAQ,GAAG,OAAO,IAAI,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9D,MAAM,cAAc,GAAG,OAAO,CAAC,QAAQ,KAAK,aAAa,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,CAAC;IAC5F,OAAO,cAAc,IAAI,QAAQ,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAA4C;IAClF,OAAO,wBAAwB,CAAC,OAAO,CAAC,IAAI,4BAA4B,CAAC,OAAO,CAAC,CAAC;AACpF,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,KAAY;IACpD,OAAO,KAAK,CAAC,GAAG,KAAK,oBAAoB,CAAC;AAC5C,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type {Args, Event, Phase, SyntheticBased} from './TraceEvents.js';\n\nexport type ExtensionEntryType = 'track-entry'|'marker';\n\nexport const extensionPalette = [\n 'primary',\n 'primary-light',\n 'primary-dark',\n 'secondary',\n 'secondary-light',\n 'secondary-dark',\n 'tertiary',\n 'tertiary-light',\n 'tertiary-dark',\n 'error',\n 'warning',\n] as const;\n\nexport type ExtensionColorFromPalette = typeof extensionPalette[number];\n\nexport function colorIsValid(color: string): boolean {\n return (extensionPalette as readonly string[]).includes(color);\n}\n\nexport interface ExtensionDataPayloadBase {\n color?: ExtensionColorFromPalette;\n properties?: [string, string][];\n tooltipText?: string;\n}\n\nexport type ExtensionDataPayload = ExtensionTrackEntryPayload|ExtensionMarkerPayload;\n\nexport interface ExtensionTrackEntryPayload extends ExtensionDataPayloadBase {\n // Typed as possibly undefined since when no data type is provided\n // the entry is defaulted to a track entry\n dataType?: 'track-entry';\n // The name of the track the entry will be displayed in.\n // Entries intended to be displayed in the same track must contain the\n // same value in this property.\n // If undefined, measurement is added to the Timings track\n track: string;\n // The track group an entry’s track belongs to.\n // Entries intended to be displayed in the same track must contain the\n // same value in this property as well as the same value in the track\n // property.\n trackGroup?: string;\n}\n\nexport interface ExtensionMarkerPayload extends ExtensionDataPayloadBase {\n dataType: 'marker';\n}\n\n/**\n * Synthetic events created for extension tracks.\n */\nexport interface SyntheticExtensionTrackEntry extends SyntheticBased<Phase.COMPLETE> {\n args: Args&ExtensionTrackEntryPayload;\n}\n\n/**\n * Synthetic events created for extension marks.\n */\nexport interface SyntheticExtensionMarker extends SyntheticBased<Phase.COMPLETE> {\n args: Args&ExtensionMarkerPayload;\n}\n\nexport type SyntheticExtensionEntry = SyntheticExtensionTrackEntry|SyntheticExtensionMarker;\n\nexport function isExtensionPayloadMarker(payload: {dataType?: string}): payload is ExtensionMarkerPayload {\n return payload.dataType === 'marker';\n}\n\nexport function isExtensionPayloadTrackEntry(payload: {track?: string, dataType?: string}):\n payload is ExtensionTrackEntryPayload {\n const hasTrack = 'track' in payload && Boolean(payload.track);\n const validEntryType = payload.dataType === 'track-entry' || payload.dataType === undefined;\n return validEntryType && hasTrack;\n}\n\nexport function isValidExtensionPayload(payload: {track?: string, dataType?: string}): payload is ExtensionDataPayload {\n return isExtensionPayloadMarker(payload) || isExtensionPayloadTrackEntry(payload);\n}\n\nexport function isSyntheticExtensionEntry(entry: Event): entry is SyntheticExtensionEntry {\n return entry.cat === 'devtools.extension';\n}\n\nexport interface ExtensionTrackData {\n // Name of the top level track. If it's a track group then this value\n // has the name of the group, otherwise it has the name of the track.\n name: string;\n isTrackGroup: boolean;\n // If this contains the data of a track group, this property contains\n // the entries of each of the tracks in the the group. If this is a\n // standalone track, then this contains that track's entries only.\n entriesByTrack: {\n [x: string]: SyntheticExtensionTrackEntry[],\n };\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type * as Protocol from '../../../generated/protocol.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import type { TraceWindowMicroSeconds } from './Timing.js';
|
|
3
|
+
import type { Event, LegacyTimelineFrame, ProcessID, SampleIndex, ThreadID } from './TraceEvents.js';
|
|
4
4
|
export type TraceFile = {
|
|
5
|
-
traceEvents: readonly
|
|
5
|
+
traceEvents: readonly Event[];
|
|
6
6
|
metadata: MetaData;
|
|
7
7
|
};
|
|
8
8
|
export interface Breadcrumb {
|
|
@@ -10,13 +10,25 @@ export interface Breadcrumb {
|
|
|
10
10
|
child: Breadcrumb | null;
|
|
11
11
|
}
|
|
12
12
|
export declare const enum DataOrigin {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
CPU_PROFILE = "CPUProfile",
|
|
14
|
+
TRACE_EVENTS = "TraceEvents"
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The Entries link can have 3 stated:
|
|
18
|
+
* 1. The Link creation is not started yet, meaning only the button that needs to be clicked to start creating the link is visible.
|
|
19
|
+
* 2. Pending to event - the creation is started, but the entry that the link points to has not been chosen yet
|
|
20
|
+
* 3. Link connected - final state, both entries present
|
|
21
|
+
*/
|
|
22
|
+
export declare const enum EntriesLinkState {
|
|
23
|
+
CREATION_NOT_STARTED = "creation_not_started",
|
|
24
|
+
PENDING_TO_EVENT = "pending_to_event",
|
|
25
|
+
CONNECTED = "connected"
|
|
15
26
|
}
|
|
16
27
|
export declare const enum EventKeyType {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
28
|
+
RAW_EVENT = "r",
|
|
29
|
+
SYNTHETIC_EVENT = "s",
|
|
30
|
+
PROFILE_CALL = "p",
|
|
31
|
+
LEGACY_TIMELINE_FRAME = "l"
|
|
20
32
|
}
|
|
21
33
|
/**
|
|
22
34
|
* Represents an object that is saved in the file when user created annotations in the timeline.
|
|
@@ -26,13 +38,14 @@ export declare const enum EventKeyType {
|
|
|
26
38
|
export interface SerializedAnnotations {
|
|
27
39
|
entryLabels: EntryLabelAnnotationSerialized[];
|
|
28
40
|
labelledTimeRanges: TimeRangeAnnotationSerialized[];
|
|
41
|
+
linksBetweenEntries: EntriesLinkAnnotationSerialized[];
|
|
29
42
|
}
|
|
30
43
|
/**
|
|
31
44
|
* Represents an object that is used to store the Entry Label annotation that is created when a user creates a label for an entry in the timeline.
|
|
32
45
|
*/
|
|
33
46
|
export interface EntryLabelAnnotation {
|
|
34
47
|
type: 'ENTRY_LABEL';
|
|
35
|
-
entry:
|
|
48
|
+
entry: Event | LegacyTimelineFrame;
|
|
36
49
|
label: string;
|
|
37
50
|
}
|
|
38
51
|
/**
|
|
@@ -43,11 +56,17 @@ export interface TimeRangeAnnotation {
|
|
|
43
56
|
label: string;
|
|
44
57
|
bounds: TraceWindowMicroSeconds;
|
|
45
58
|
}
|
|
59
|
+
export interface EntriesLinkAnnotation {
|
|
60
|
+
type: 'ENTRIES_LINK';
|
|
61
|
+
state: EntriesLinkState;
|
|
62
|
+
entryFrom: Event;
|
|
63
|
+
entryTo?: Event;
|
|
64
|
+
}
|
|
46
65
|
/**
|
|
47
66
|
* Represents an object that is saved in the file when a user creates a label for an entry in the timeline.
|
|
48
67
|
*/
|
|
49
68
|
export interface EntryLabelAnnotationSerialized {
|
|
50
|
-
entry:
|
|
69
|
+
entry: SerializableKey;
|
|
51
70
|
label: string;
|
|
52
71
|
}
|
|
53
72
|
/**
|
|
@@ -57,6 +76,13 @@ export interface TimeRangeAnnotationSerialized {
|
|
|
57
76
|
bounds: TraceWindowMicroSeconds;
|
|
58
77
|
label: string;
|
|
59
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Represents an object that is saved in the file when a user creates a link between entries in the timeline.
|
|
81
|
+
*/
|
|
82
|
+
export interface EntriesLinkAnnotationSerialized {
|
|
83
|
+
entryFrom: SerializableKey;
|
|
84
|
+
entryTo: SerializableKey;
|
|
85
|
+
}
|
|
60
86
|
/**
|
|
61
87
|
* `Annotation` are the user-created annotations that are saved into the metadata.
|
|
62
88
|
* Those annotations are rendered on the timeline by `Overlays.ts`
|
|
@@ -64,33 +90,39 @@ export interface TimeRangeAnnotationSerialized {
|
|
|
64
90
|
* TODO: Implement other OverlayAnnotations (annotated time ranges, links between entries).
|
|
65
91
|
* TODO: Save/load overlay annotations to/from the trace file.
|
|
66
92
|
*/
|
|
67
|
-
export type Annotation = EntryLabelAnnotation | TimeRangeAnnotation;
|
|
93
|
+
export type Annotation = EntryLabelAnnotation | TimeRangeAnnotation | EntriesLinkAnnotation;
|
|
68
94
|
export declare function isTimeRangeAnnotation(annotation: Annotation): annotation is TimeRangeAnnotation;
|
|
69
95
|
export declare function isEntryLabelAnnotation(annotation: Annotation): annotation is EntryLabelAnnotation;
|
|
70
|
-
export
|
|
71
|
-
export type
|
|
72
|
-
export type
|
|
73
|
-
export type
|
|
96
|
+
export declare function isEntriesLinkAnnotation(annotation: Annotation): annotation is EntriesLinkAnnotation;
|
|
97
|
+
export type RawEventKey = `${EventKeyType.RAW_EVENT}-${number}`;
|
|
98
|
+
export type SyntheticEventKey = `${EventKeyType.SYNTHETIC_EVENT}-${number}`;
|
|
99
|
+
export type ProfileCallKey = `${EventKeyType.PROFILE_CALL}-${ProcessID}-${ThreadID}-${SampleIndex}-${Protocol.integer}`;
|
|
100
|
+
export type LegacyTimelineFrameKey = `${EventKeyType.LEGACY_TIMELINE_FRAME}-${number}`;
|
|
101
|
+
export type SerializableKey = RawEventKey | ProfileCallKey | SyntheticEventKey | LegacyTimelineFrameKey;
|
|
74
102
|
export type RawEventKeyValues = {
|
|
75
|
-
type: EventKeyType.
|
|
103
|
+
type: EventKeyType.RAW_EVENT;
|
|
76
104
|
rawIndex: number;
|
|
77
105
|
};
|
|
78
106
|
export type SyntheticEventKeyValues = {
|
|
79
|
-
type: EventKeyType.
|
|
107
|
+
type: EventKeyType.SYNTHETIC_EVENT;
|
|
80
108
|
rawIndex: number;
|
|
81
109
|
};
|
|
82
110
|
export type ProfileCallKeyValues = {
|
|
83
|
-
type: EventKeyType.
|
|
111
|
+
type: EventKeyType.PROFILE_CALL;
|
|
84
112
|
processID: ProcessID;
|
|
85
113
|
threadID: ThreadID;
|
|
86
114
|
sampleIndex: SampleIndex;
|
|
87
115
|
protocol: Protocol.integer;
|
|
88
116
|
};
|
|
89
|
-
export type
|
|
117
|
+
export type LegacyTimelineFrameKeyValues = {
|
|
118
|
+
type: EventKeyType.LEGACY_TIMELINE_FRAME;
|
|
119
|
+
rawIndex: number;
|
|
120
|
+
};
|
|
121
|
+
export type SerializableKeyValues = RawEventKeyValues | ProfileCallKeyValues | SyntheticEventKeyValues | LegacyTimelineFrameKeyValues;
|
|
90
122
|
export interface Modifications {
|
|
91
123
|
entriesModifications: {
|
|
92
|
-
hiddenEntries:
|
|
93
|
-
expandableEntries:
|
|
124
|
+
hiddenEntries: SerializableKey[];
|
|
125
|
+
expandableEntries: SerializableKey[];
|
|
94
126
|
};
|
|
95
127
|
initialBreadcrumb: Breadcrumb;
|
|
96
128
|
annotations: SerializedAnnotations;
|
|
@@ -110,5 +142,5 @@ export interface MetaData {
|
|
|
110
142
|
modifications?: Modifications;
|
|
111
143
|
enhancedTraceVersion?: number;
|
|
112
144
|
}
|
|
113
|
-
export type Contents = TraceFile |
|
|
114
|
-
export declare function traceEventKeyToValues(key:
|
|
145
|
+
export type Contents = TraceFile | Event[];
|
|
146
|
+
export declare function traceEventKeyToValues(key: SerializableKey): SerializableKeyValues;
|
|
@@ -4,11 +4,14 @@ export function isTimeRangeAnnotation(annotation) {
|
|
|
4
4
|
export function isEntryLabelAnnotation(annotation) {
|
|
5
5
|
return annotation.type === 'ENTRY_LABEL';
|
|
6
6
|
}
|
|
7
|
+
export function isEntriesLinkAnnotation(annotation) {
|
|
8
|
+
return annotation.type === 'ENTRIES_LINK';
|
|
9
|
+
}
|
|
7
10
|
export function traceEventKeyToValues(key) {
|
|
8
11
|
const parts = key.split('-');
|
|
9
12
|
const type = parts[0];
|
|
10
13
|
switch (type) {
|
|
11
|
-
case "p" /* EventKeyType.
|
|
14
|
+
case "p" /* EventKeyType.PROFILE_CALL */:
|
|
12
15
|
if (parts.length !== 5 ||
|
|
13
16
|
!(parts.every((part, i) => i === 0 || typeof part === 'number' || !isNaN(parseInt(part, 10))))) {
|
|
14
17
|
throw new Error(`Invalid ProfileCallKey: ${key}`);
|
|
@@ -20,7 +23,7 @@ export function traceEventKeyToValues(key) {
|
|
|
20
23
|
sampleIndex: parseInt(parts[3], 10),
|
|
21
24
|
protocol: parseInt(parts[4], 10),
|
|
22
25
|
};
|
|
23
|
-
case "r" /* EventKeyType.
|
|
26
|
+
case "r" /* EventKeyType.RAW_EVENT */:
|
|
24
27
|
if (parts.length !== 2 || !(typeof parts[1] === 'number' || !isNaN(parseInt(parts[1], 10)))) {
|
|
25
28
|
throw new Error(`Invalid RawEvent Key: ${key}`);
|
|
26
29
|
}
|
|
@@ -28,7 +31,7 @@ export function traceEventKeyToValues(key) {
|
|
|
28
31
|
type: parts[0],
|
|
29
32
|
rawIndex: parseInt(parts[1], 10),
|
|
30
33
|
};
|
|
31
|
-
case "s" /* EventKeyType.
|
|
34
|
+
case "s" /* EventKeyType.SYNTHETIC_EVENT */:
|
|
32
35
|
if (parts.length !== 2 || !(typeof parts[1] === 'number' || !isNaN(parseInt(parts[1], 10)))) {
|
|
33
36
|
throw new Error(`Invalid SyntheticEvent Key: ${key}`);
|
|
34
37
|
}
|
|
@@ -36,6 +39,15 @@ export function traceEventKeyToValues(key) {
|
|
|
36
39
|
type: parts[0],
|
|
37
40
|
rawIndex: parseInt(parts[1], 10),
|
|
38
41
|
};
|
|
42
|
+
case "l" /* EventKeyType.LEGACY_TIMELINE_FRAME */: {
|
|
43
|
+
if (parts.length !== 2 || Number.isNaN(parseInt(parts[1], 10))) {
|
|
44
|
+
throw new Error(`Invalid LegacyTimelineFrame Key: ${key}`);
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
type,
|
|
48
|
+
rawIndex: parseInt(parts[1], 10),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
39
51
|
default:
|
|
40
52
|
throw new Error(`Unknown trace event key: ${key}`);
|
|
41
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"File.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/File.ts"],"names":[],"mappings":"AAkFA,MAAM,UAAU,qBAAqB,CAAC,UAAsB;IAC1D,OAAO,UAAU,CAAC,IAAI,KAAK,YAAY,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,UAAsB;IAC3D,OAAO,UAAU,CAAC,IAAI,KAAK,aAAa,CAAC;AAC3C,CAAC;AA6DD,MAAM,UAAU,qBAAqB,CAAC,GAA8B;IAClE,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7B,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAEtB,QAAQ,IAAI,EAAE,CAAC;QACb;YACE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;gBAClB,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBACnG,MAAM,IAAI,KAAK,CAAC,2BAA2B,GAAG,EAAE,CAAC,CAAC;YACpD,CAAC;YACD,OAAO;gBACL,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;gBACd,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;gBACjC,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;gBAChC,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;gBACnC,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;aACT,CAAC;QAC5B;YACE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC5F,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,EAAE,CAAC,CAAC;YAClD,CAAC;YACD,OAAO;gBACL,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;gBACd,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;aACZ,CAAC;QACzB;YACE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC5F,MAAM,IAAI,KAAK,CAAC,+BAA+B,GAAG,EAAE,CAAC,CAAC;YACxD,CAAC;YACD,OAAO;gBACL,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;gBACd,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;aACN,CAAC;QAC/B;YACE,MAAM,IAAI,KAAK,CAAC,4BAA4B,GAAG,EAAE,CAAC,CAAC;IACvD,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\nimport type * as Protocol from '../../../generated/protocol.js';\n\nimport {type TraceWindowMicroSeconds} from './Timing.js';\nimport {type ProcessID, type SampleIndex, type ThreadID, type TraceEventData} from './TraceEvents.js';\n\nexport type TraceFile = {\n traceEvents: readonly TraceEventData[],\n metadata: MetaData,\n};\n\nexport interface Breadcrumb {\n window: TraceWindowMicroSeconds;\n child: Breadcrumb|null;\n}\n\nexport const enum DataOrigin {\n CPUProfile = 'CPUProfile',\n TraceEvents = 'TraceEvents',\n}\n\nexport const enum EventKeyType {\n RawEvent = 'r',\n SyntheticEvent = 's',\n ProfileCall = 'p',\n}\n\n/**\n * Represents an object that is saved in the file when user created annotations in the timeline.\n *\n * Expected to add more annotations.\n */\nexport interface SerializedAnnotations {\n entryLabels: EntryLabelAnnotationSerialized[];\n labelledTimeRanges: TimeRangeAnnotationSerialized[];\n}\n\n/**\n * Represents an object that is used to store the Entry Label annotation that is created when a user creates a label for an entry in the timeline.\n */\nexport interface EntryLabelAnnotation {\n type: 'ENTRY_LABEL';\n entry: TraceEventData;\n label: string;\n}\n\n/**\n * Represents an object that is used to store the Labelled Time Range Annotation that is created when a user creates a Time Range Selection in the timeline.\n */\nexport interface TimeRangeAnnotation {\n type: 'TIME_RANGE';\n label: string;\n bounds: TraceWindowMicroSeconds;\n}\n\n/**\n * Represents an object that is saved in the file when a user creates a label for an entry in the timeline.\n */\nexport interface EntryLabelAnnotationSerialized {\n entry: TraceEventSerializableKey;\n label: string;\n}\n\n/**\n * Represents an object that is saved in the file when a user creates a time range with a label in the timeline.\n */\nexport interface TimeRangeAnnotationSerialized {\n bounds: TraceWindowMicroSeconds;\n label: string;\n}\n\n/**\n * `Annotation` are the user-created annotations that are saved into the metadata.\n * Those annotations are rendered on the timeline by `Overlays.ts`\n *\n * TODO: Implement other OverlayAnnotations (annotated time ranges, links between entries).\n * TODO: Save/load overlay annotations to/from the trace file.\n */\nexport type Annotation = EntryLabelAnnotation|TimeRangeAnnotation;\n\nexport function isTimeRangeAnnotation(annotation: Annotation): annotation is TimeRangeAnnotation {\n return annotation.type === 'TIME_RANGE';\n}\n\nexport function isEntryLabelAnnotation(annotation: Annotation): annotation is EntryLabelAnnotation {\n return annotation.type === 'ENTRY_LABEL';\n}\n\n// Serializable keys are created for trace events to be able to save\n// references to timeline events in a trace file. These keys enable\n// user modifications that can be saved. See go/cpq:event-data-json for\n// more details on the key format.\nexport type RawEventKey = `${EventKeyType.RawEvent}-${number}`;\nexport type SyntheticEventKey = `${EventKeyType.SyntheticEvent}-${number}`;\nexport type ProfileCallKey = `${EventKeyType.ProfileCall}-${ProcessID}-${ThreadID}-${SampleIndex}-${Protocol.integer}`;\nexport type TraceEventSerializableKey = RawEventKey|ProfileCallKey|SyntheticEventKey;\n\n// Serializable keys values objects contain data that maps the keys to original Trace Events\nexport type RawEventKeyValues = {\n type: EventKeyType.RawEvent,\n rawIndex: number,\n};\n\nexport type SyntheticEventKeyValues = {\n type: EventKeyType.SyntheticEvent,\n rawIndex: number,\n};\n\nexport type ProfileCallKeyValues = {\n type: EventKeyType.ProfileCall,\n processID: ProcessID,\n threadID: ThreadID,\n sampleIndex: SampleIndex,\n protocol: Protocol.integer,\n};\n\nexport type TraceEventSerializableKeyValues = RawEventKeyValues|ProfileCallKeyValues|SyntheticEventKeyValues;\n\nexport interface Modifications {\n entriesModifications: {\n // Entries hidden by the user\n hiddenEntries: TraceEventSerializableKey[],\n // Entries that parent a hiddenEntry\n expandableEntries: TraceEventSerializableKey[],\n };\n initialBreadcrumb: Breadcrumb;\n annotations: SerializedAnnotations;\n}\n\n/**\n * Trace metadata that we persist to the file. This will allow us to\n * store specifics for the trace, e.g., which tracks should be visible\n * on load.\n */\nexport interface MetaData {\n source?: 'DevTools';\n startTime?: string;\n networkThrottling?: string;\n cpuThrottling?: number;\n hardwareConcurrency?: number;\n dataOrigin?: DataOrigin;\n modifications?: Modifications;\n enhancedTraceVersion?: number;\n}\n\nexport type Contents = TraceFile|TraceEventData[];\n\nexport function traceEventKeyToValues(key: TraceEventSerializableKey): TraceEventSerializableKeyValues {\n const parts = key.split('-');\n const type = parts[0];\n\n switch (type) {\n case EventKeyType.ProfileCall:\n if (parts.length !== 5 ||\n !(parts.every((part, i) => i === 0 || typeof part === 'number' || !isNaN(parseInt(part, 10))))) {\n throw new Error(`Invalid ProfileCallKey: ${key}`);\n }\n return {\n type: parts[0],\n processID: parseInt(parts[1], 10),\n threadID: parseInt(parts[2], 10),\n sampleIndex: parseInt(parts[3], 10),\n protocol: parseInt(parts[4], 10),\n } as ProfileCallKeyValues;\n case EventKeyType.RawEvent:\n if (parts.length !== 2 || !(typeof parts[1] === 'number' || !isNaN(parseInt(parts[1], 10)))) {\n throw new Error(`Invalid RawEvent Key: ${key}`);\n }\n return {\n type: parts[0],\n rawIndex: parseInt(parts[1], 10),\n } as RawEventKeyValues;\n case EventKeyType.SyntheticEvent:\n if (parts.length !== 2 || !(typeof parts[1] === 'number' || !isNaN(parseInt(parts[1], 10)))) {\n throw new Error(`Invalid SyntheticEvent Key: ${key}`);\n }\n return {\n type: parts[0],\n rawIndex: parseInt(parts[1], 10),\n } as SyntheticEventKeyValues;\n default:\n throw new Error(`Unknown trace event key: ${key}`);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"File.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/File.ts"],"names":[],"mappings":"AA+GA,MAAM,UAAU,qBAAqB,CAAC,UAAsB;IAC1D,OAAO,UAAU,CAAC,IAAI,KAAK,YAAY,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,UAAsB;IAC3D,OAAO,UAAU,CAAC,IAAI,KAAK,aAAa,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,UAAsB;IAC5D,OAAO,UAAU,CAAC,IAAI,KAAK,cAAc,CAAC;AAC5C,CAAC;AAoED,MAAM,UAAU,qBAAqB,CAAC,GAAoB;IACxD,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7B,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAEtB,QAAQ,IAAI,EAAE,CAAC;QACb;YACE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;gBAClB,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBACnG,MAAM,IAAI,KAAK,CAAC,2BAA2B,GAAG,EAAE,CAAC,CAAC;YACpD,CAAC;YACD,OAAO;gBACL,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;gBACd,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;gBACjC,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;gBAChC,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;gBACnC,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;aACT,CAAC;QAC5B;YACE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC5F,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,EAAE,CAAC,CAAC;YAClD,CAAC;YACD,OAAO;gBACL,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;gBACd,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;aACZ,CAAC;QACzB;YACE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC5F,MAAM,IAAI,KAAK,CAAC,+BAA+B,GAAG,EAAE,CAAC,CAAC;YACxD,CAAC;YACD,OAAO;gBACL,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;gBACd,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;aACN,CAAC;QAC/B,iDAAuC,CAAC,CAAC,CAAC;YACxC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC;gBAC/D,MAAM,IAAI,KAAK,CAAC,oCAAoC,GAAG,EAAE,CAAC,CAAC;YAC7D,CAAC;YACD,OAAO;gBACL,IAAI;gBACJ,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;aACjC,CAAC;QACJ,CAAC;QAED;YACE,MAAM,IAAI,KAAK,CAAC,4BAA4B,GAAG,EAAE,CAAC,CAAC;IACvD,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\nimport type * as Protocol from '../../../generated/protocol.js';\n\nimport type {TraceWindowMicroSeconds} from './Timing.js';\nimport type {Event, LegacyTimelineFrame, ProcessID, SampleIndex, ThreadID} from './TraceEvents.js';\n\nexport type TraceFile = {\n traceEvents: readonly Event[],\n metadata: MetaData,\n};\n\nexport interface Breadcrumb {\n window: TraceWindowMicroSeconds;\n child: Breadcrumb|null;\n}\n\nexport const enum DataOrigin {\n CPU_PROFILE = 'CPUProfile',\n TRACE_EVENTS = 'TraceEvents',\n}\n\n/**\n * The Entries link can have 3 stated:\n * 1. The Link creation is not started yet, meaning only the button that needs to be clicked to start creating the link is visible.\n * 2. Pending to event - the creation is started, but the entry that the link points to has not been chosen yet\n * 3. Link connected - final state, both entries present\n */\nexport const enum EntriesLinkState {\n CREATION_NOT_STARTED = 'creation_not_started',\n PENDING_TO_EVENT = 'pending_to_event',\n CONNECTED = 'connected',\n}\n\nexport const enum EventKeyType {\n RAW_EVENT = 'r',\n SYNTHETIC_EVENT = 's',\n PROFILE_CALL = 'p',\n LEGACY_TIMELINE_FRAME = 'l',\n}\n\n/**\n * Represents an object that is saved in the file when user created annotations in the timeline.\n *\n * Expected to add more annotations.\n */\nexport interface SerializedAnnotations {\n entryLabels: EntryLabelAnnotationSerialized[];\n labelledTimeRanges: TimeRangeAnnotationSerialized[];\n linksBetweenEntries: EntriesLinkAnnotationSerialized[];\n}\n\n/**\n * Represents an object that is used to store the Entry Label annotation that is created when a user creates a label for an entry in the timeline.\n */\nexport interface EntryLabelAnnotation {\n type: 'ENTRY_LABEL';\n entry: Event|LegacyTimelineFrame;\n label: string;\n}\n\n/**\n * Represents an object that is used to store the Labelled Time Range Annotation that is created when a user creates a Time Range Selection in the timeline.\n */\nexport interface TimeRangeAnnotation {\n type: 'TIME_RANGE';\n label: string;\n bounds: TraceWindowMicroSeconds;\n}\n\nexport interface EntriesLinkAnnotation {\n type: 'ENTRIES_LINK';\n state: EntriesLinkState;\n entryFrom: Event;\n entryTo?: Event;\n}\n\n/**\n * Represents an object that is saved in the file when a user creates a label for an entry in the timeline.\n */\nexport interface EntryLabelAnnotationSerialized {\n entry: SerializableKey;\n label: string;\n}\n\n/**\n * Represents an object that is saved in the file when a user creates a time range with a label in the timeline.\n */\nexport interface TimeRangeAnnotationSerialized {\n bounds: TraceWindowMicroSeconds;\n label: string;\n}\n\n/**\n * Represents an object that is saved in the file when a user creates a link between entries in the timeline.\n */\nexport interface EntriesLinkAnnotationSerialized {\n entryFrom: SerializableKey;\n entryTo: SerializableKey;\n}\n\n/**\n * `Annotation` are the user-created annotations that are saved into the metadata.\n * Those annotations are rendered on the timeline by `Overlays.ts`\n *\n * TODO: Implement other OverlayAnnotations (annotated time ranges, links between entries).\n * TODO: Save/load overlay annotations to/from the trace file.\n */\nexport type Annotation = EntryLabelAnnotation|TimeRangeAnnotation|EntriesLinkAnnotation;\n\nexport function isTimeRangeAnnotation(annotation: Annotation): annotation is TimeRangeAnnotation {\n return annotation.type === 'TIME_RANGE';\n}\n\nexport function isEntryLabelAnnotation(annotation: Annotation): annotation is EntryLabelAnnotation {\n return annotation.type === 'ENTRY_LABEL';\n}\n\nexport function isEntriesLinkAnnotation(annotation: Annotation): annotation is EntriesLinkAnnotation {\n return annotation.type === 'ENTRIES_LINK';\n}\n\n// Serializable keys are created for trace events to be able to save\n// references to timeline events in a trace file. These keys enable\n// user modifications that can be saved. See go/cpq:event-data-json for\n// more details on the key format.\nexport type RawEventKey = `${EventKeyType.RAW_EVENT}-${number}`;\nexport type SyntheticEventKey = `${EventKeyType.SYNTHETIC_EVENT}-${number}`;\nexport type ProfileCallKey = `${EventKeyType.PROFILE_CALL}-${ProcessID}-${ThreadID}-${SampleIndex}-${Protocol.integer}`;\nexport type LegacyTimelineFrameKey = `${EventKeyType.LEGACY_TIMELINE_FRAME}-${number}`;\nexport type SerializableKey = RawEventKey|ProfileCallKey|SyntheticEventKey|LegacyTimelineFrameKey;\n\n// Serializable keys values objects contain data that maps the keys to original Trace Events\nexport type RawEventKeyValues = {\n type: EventKeyType.RAW_EVENT,\n rawIndex: number,\n};\n\nexport type SyntheticEventKeyValues = {\n type: EventKeyType.SYNTHETIC_EVENT,\n rawIndex: number,\n};\n\nexport type ProfileCallKeyValues = {\n type: EventKeyType.PROFILE_CALL,\n processID: ProcessID,\n threadID: ThreadID,\n sampleIndex: SampleIndex,\n protocol: Protocol.integer,\n};\n\nexport type LegacyTimelineFrameKeyValues = {\n type: EventKeyType.LEGACY_TIMELINE_FRAME,\n rawIndex: number,\n};\n\nexport type SerializableKeyValues =\n RawEventKeyValues|ProfileCallKeyValues|SyntheticEventKeyValues|LegacyTimelineFrameKeyValues;\n\nexport interface Modifications {\n entriesModifications: {\n // Entries hidden by the user\n hiddenEntries: SerializableKey[],\n // Entries that parent a hiddenEntry\n expandableEntries: SerializableKey[],\n };\n initialBreadcrumb: Breadcrumb;\n annotations: SerializedAnnotations;\n}\n\n/**\n * Trace metadata that we persist to the file. This will allow us to\n * store specifics for the trace, e.g., which tracks should be visible\n * on load.\n */\nexport interface MetaData {\n source?: 'DevTools';\n startTime?: string;\n networkThrottling?: string;\n cpuThrottling?: number;\n hardwareConcurrency?: number;\n dataOrigin?: DataOrigin;\n modifications?: Modifications;\n enhancedTraceVersion?: number;\n}\n\nexport type Contents = TraceFile|Event[];\n\nexport function traceEventKeyToValues(key: SerializableKey): SerializableKeyValues {\n const parts = key.split('-');\n const type = parts[0];\n\n switch (type) {\n case EventKeyType.PROFILE_CALL:\n if (parts.length !== 5 ||\n !(parts.every((part, i) => i === 0 || typeof part === 'number' || !isNaN(parseInt(part, 10))))) {\n throw new Error(`Invalid ProfileCallKey: ${key}`);\n }\n return {\n type: parts[0],\n processID: parseInt(parts[1], 10),\n threadID: parseInt(parts[2], 10),\n sampleIndex: parseInt(parts[3], 10),\n protocol: parseInt(parts[4], 10),\n } as ProfileCallKeyValues;\n case EventKeyType.RAW_EVENT:\n if (parts.length !== 2 || !(typeof parts[1] === 'number' || !isNaN(parseInt(parts[1], 10)))) {\n throw new Error(`Invalid RawEvent Key: ${key}`);\n }\n return {\n type: parts[0],\n rawIndex: parseInt(parts[1], 10),\n } as RawEventKeyValues;\n case EventKeyType.SYNTHETIC_EVENT:\n if (parts.length !== 2 || !(typeof parts[1] === 'number' || !isNaN(parseInt(parts[1], 10)))) {\n throw new Error(`Invalid SyntheticEvent Key: ${key}`);\n }\n return {\n type: parts[0],\n rawIndex: parseInt(parts[1], 10),\n } as SyntheticEventKeyValues;\n case EventKeyType.LEGACY_TIMELINE_FRAME: {\n if (parts.length !== 2 || Number.isNaN(parseInt(parts[1], 10))) {\n throw new Error(`Invalid LegacyTimelineFrame Key: ${key}`);\n }\n return {\n type,\n rawIndex: parseInt(parts[1], 10),\n };\n }\n\n default:\n throw new Error(`Unknown trace event key: ${key}`);\n }\n}\n"]}
|