@paulirish/trace_engine 0.0.54 → 0.0.56
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/models/trace/extras/polyfills.d.ts +4 -0
- package/.tmp/tsbuildinfo/models/trace/extras/polyfills.d.ts.map +1 -0
- package/.tmp/tsbuildinfo/tsconfig.tsbuildinfo +1 -1
- package/core/platform/MimeType.d.ts +3 -2
- package/core/platform/MimeType.js +4 -3
- package/core/platform/MimeType.js.map +1 -1
- package/core/platform/devtools_entrypoint-bundle-tsconfig-tsconfig.json +43 -0
- package/core/platform/platform.prebundle.d.ts +18 -0
- package/core/platform/platform.prebundle.js +53 -0
- package/core/platform/platform.prebundle.js.map +1 -0
- package/core/platform/platform.prebundle.ts +71 -0
- package/generated/protocol.d.ts +115 -16
- package/locales/af.json +52 -10
- package/locales/am.json +52 -10
- package/locales/ar.json +51 -9
- package/locales/as.json +52 -10
- package/locales/az.json +52 -10
- package/locales/be.json +52 -10
- package/locales/bg.json +52 -10
- package/locales/bn.json +52 -10
- package/locales/bs.json +52 -10
- package/locales/ca.json +52 -10
- package/locales/cs.json +52 -10
- package/locales/cy.json +52 -10
- package/locales/da.json +52 -10
- package/locales/de.json +52 -10
- package/locales/el.json +52 -10
- package/locales/en-GB.json +52 -10
- package/locales/en-US.json +70 -58
- package/locales/en-XL.json +70 -58
- package/locales/es-419.json +52 -10
- package/locales/es.json +50 -8
- package/locales/et.json +52 -10
- package/locales/eu.json +52 -10
- package/locales/fa.json +51 -9
- package/locales/fi.json +52 -10
- package/locales/fil.json +52 -10
- package/locales/fr-CA.json +52 -10
- package/locales/fr.json +52 -10
- package/locales/gl.json +52 -10
- package/locales/gu.json +52 -10
- package/locales/he.json +52 -10
- package/locales/hi.json +52 -10
- package/locales/hr.json +52 -10
- package/locales/hu.json +51 -9
- package/locales/hy.json +51 -9
- package/locales/id.json +52 -10
- package/locales/is.json +53 -11
- package/locales/it.json +51 -9
- package/locales/ja.json +52 -10
- package/locales/ka.json +53 -11
- package/locales/kk.json +51 -9
- package/locales/km.json +52 -10
- package/locales/kn.json +52 -10
- package/locales/ko.json +52 -10
- package/locales/ky.json +51 -9
- package/locales/lo.json +52 -10
- package/locales/lt.json +52 -10
- package/locales/lv.json +51 -9
- package/locales/mk.json +52 -10
- package/locales/ml.json +53 -11
- package/locales/mn.json +52 -10
- package/locales/mr.json +52 -10
- package/locales/ms.json +52 -10
- package/locales/my.json +51 -9
- package/locales/ne.json +52 -10
- package/locales/nl.json +52 -10
- package/locales/no.json +52 -10
- package/locales/or.json +53 -11
- package/locales/pa.json +53 -11
- package/locales/pl.json +51 -9
- package/locales/pt-PT.json +52 -10
- package/locales/pt.json +52 -10
- package/locales/ro.json +52 -10
- package/locales/ru.json +53 -11
- package/locales/si.json +52 -10
- package/locales/sk.json +51 -9
- package/locales/sl.json +51 -9
- package/locales/sq.json +52 -10
- package/locales/sr-Latn.json +52 -10
- package/locales/sr.json +52 -10
- package/locales/sv.json +52 -10
- package/locales/sw.json +51 -9
- package/locales/ta.json +52 -10
- package/locales/te.json +52 -10
- package/locales/th.json +51 -9
- package/locales/tr.json +52 -10
- package/locales/uk.json +52 -10
- package/locales/ur.json +52 -10
- package/locales/uz.json +51 -9
- package/locales/vi.json +52 -10
- package/locales/zh-HK.json +52 -10
- package/locales/zh-TW.json +51 -9
- package/locales/zh.json +52 -10
- package/locales/zu.json +52 -10
- package/models/cpu_profile/CPUProfileDataModel.d.ts +4 -2
- package/models/cpu_profile/CPUProfileDataModel.js.map +1 -1
- package/models/cpu_profile/ProfileTreeModel.d.ts +0 -1
- package/models/cpu_profile/ProfileTreeModel.js +0 -2
- package/models/cpu_profile/ProfileTreeModel.js.map +1 -1
- package/models/cpu_profile/cpu_profile.prebundle.d.ts +3 -0
- package/models/cpu_profile/cpu_profile.prebundle.js +7 -0
- package/models/cpu_profile/cpu_profile.prebundle.js.map +1 -0
- package/models/cpu_profile/cpu_profile.prebundle.ts +11 -0
- package/models/cpu_profile/devtools_entrypoint-bundle-tsconfig-tsconfig.json +43 -0
- package/models/trace/LanternComputationData.js +7 -6
- package/models/trace/LanternComputationData.js.map +1 -1
- package/models/trace/Processor.js +25 -18
- package/models/trace/Processor.js.map +1 -1
- package/models/trace/devtools_entrypoint-bundle-tsconfig-tsconfig.json +61 -0
- package/models/trace/{root-causes/devtools_entrypoint-bundle-typescript-tsconfig.json → extras/devtools_entrypoint-bundle-tsconfig-tsconfig.json} +5 -4
- package/models/trace/extras/extras-tsconfig.json +0 -2
- package/models/trace/extras/extras.js.map +1 -1
- package/models/trace/extras/extras.prebundle.d.ts +7 -0
- package/models/trace/extras/extras.prebundle.js +11 -0
- package/models/trace/extras/extras.prebundle.js.map +1 -0
- package/models/trace/extras/extras.prebundle.ts +11 -0
- package/models/trace/handlers/ImagePaintingHandler.d.ts +7 -1
- package/models/trace/handlers/ImagePaintingHandler.js +33 -1
- package/models/trace/handlers/ImagePaintingHandler.js.map +1 -1
- package/models/trace/handlers/MetaHandler.js +2 -0
- package/models/trace/handlers/MetaHandler.js.map +1 -1
- package/models/trace/handlers/NetworkRequestsHandler.d.ts +0 -5
- package/models/trace/handlers/NetworkRequestsHandler.js +61 -20
- package/models/trace/handlers/NetworkRequestsHandler.js.map +1 -1
- package/models/trace/handlers/SamplesHandler.js +7 -2
- package/models/trace/handlers/SamplesHandler.js.map +1 -1
- package/models/trace/handlers/ScriptsHandler.js.map +1 -1
- package/models/trace/{root-causes/root-causes-tsconfig.json → handlers/devtools_entrypoint-bundle-tsconfig-tsconfig.json} +5 -17
- package/models/trace/handlers/handlers.prebundle.d.ts +4 -0
- package/models/trace/handlers/handlers.prebundle.js +8 -0
- package/models/trace/handlers/handlers.prebundle.js.map +1 -0
- package/models/trace/handlers/handlers.prebundle.ts +8 -0
- package/models/trace/helpers/SamplesIntegrator.js +8 -13
- package/models/trace/helpers/SamplesIntegrator.js.map +1 -1
- package/models/trace/helpers/Trace.js +0 -7
- package/models/trace/helpers/Trace.js.map +1 -1
- package/models/trace/helpers/devtools_entrypoint-bundle-tsconfig-tsconfig.json +43 -0
- package/models/trace/helpers/helpers.prebundle.d.ts +7 -0
- package/models/trace/helpers/helpers.prebundle.js +11 -0
- package/models/trace/helpers/helpers.prebundle.js.map +1 -0
- package/models/trace/helpers/helpers.prebundle.ts +11 -0
- package/models/trace/insights/CLSCulprits.d.ts +27 -7
- package/models/trace/insights/CLSCulprits.js +34 -15
- package/models/trace/insights/CLSCulprits.js.map +1 -1
- package/models/trace/insights/Common.d.ts +1 -1
- package/models/trace/insights/Common.js +3 -3
- package/models/trace/insights/Common.js.map +1 -1
- package/models/trace/insights/DOMSize.d.ts +26 -1
- package/models/trace/insights/DOMSize.js +34 -1
- package/models/trace/insights/DOMSize.js.map +1 -1
- package/models/trace/insights/DocumentLatency.d.ts +2 -2
- package/models/trace/insights/DocumentLatency.js +3 -3
- package/models/trace/insights/DocumentLatency.js.map +1 -1
- package/models/trace/insights/ForcedReflow.d.ts +1 -1
- package/models/trace/insights/ForcedReflow.js +1 -1
- package/models/trace/insights/ForcedReflow.js.map +1 -1
- package/models/trace/insights/{InteractionToNextPaint.d.ts → INPBreakdown.d.ts} +8 -8
- package/models/trace/insights/{InteractionToNextPaint.js → INPBreakdown.js} +10 -10
- package/models/trace/insights/INPBreakdown.js.map +1 -0
- package/models/trace/insights/ImageDelivery.js +18 -7
- package/models/trace/insights/ImageDelivery.js.map +1 -1
- package/models/trace/insights/{LCPPhases.d.ts → LCPBreakdown.d.ts} +26 -22
- package/models/trace/insights/{LCPPhases.js → LCPBreakdown.js} +56 -46
- package/models/trace/insights/LCPBreakdown.js.map +1 -0
- package/models/trace/insights/LCPDiscovery.js +1 -1
- package/models/trace/insights/LCPDiscovery.js.map +1 -1
- package/models/trace/insights/Models.d.ts +2 -2
- package/models/trace/insights/Models.js +2 -2
- package/models/trace/insights/Models.js.map +1 -1
- package/models/trace/insights/NetworkDependencyTree.d.ts +34 -8
- package/models/trace/insights/NetworkDependencyTree.js +144 -18
- package/models/trace/insights/NetworkDependencyTree.js.map +1 -1
- package/models/trace/insights/Viewport.d.ts +8 -2
- package/models/trace/insights/Viewport.js +16 -1
- package/models/trace/insights/Viewport.js.map +1 -1
- package/models/trace/insights/devtools_entrypoint-bundle-tsconfig-tsconfig.json +43 -0
- package/models/trace/insights/insights-tsconfig.json +2 -2
- package/models/trace/insights/insights.prebundle.d.ts +4 -0
- package/models/trace/insights/insights.prebundle.js +8 -0
- package/models/trace/insights/insights.prebundle.js.map +1 -0
- package/models/trace/insights/insights.prebundle.ts +8 -0
- package/models/trace/insights/types.d.ts +2 -2
- package/models/trace/insights/types.js +2 -2
- package/models/trace/insights/types.js.map +1 -1
- package/models/trace/lantern/core/core.prebundle.d.ts +2 -0
- package/models/trace/lantern/core/core.prebundle.js +6 -0
- package/models/trace/lantern/core/core.prebundle.js.map +1 -0
- package/models/trace/lantern/core/core.prebundle.ts +6 -0
- package/models/trace/lantern/core/devtools_entrypoint-bundle-tsconfig-tsconfig.json +43 -0
- package/models/trace/lantern/devtools_entrypoint-bundle-tsconfig-tsconfig.json +43 -0
- package/models/trace/lantern/graph/BaseNode.d.ts +5 -2
- package/models/trace/lantern/graph/BaseNode.js +8 -5
- package/models/trace/lantern/graph/BaseNode.js.map +1 -1
- package/models/trace/lantern/graph/PageDependencyGraph.js +46 -3
- package/models/trace/lantern/graph/PageDependencyGraph.js.map +1 -1
- package/models/trace/lantern/graph/devtools_entrypoint-bundle-tsconfig-tsconfig.json +43 -0
- package/models/trace/lantern/graph/graph.prebundle.d.ts +4 -0
- package/models/trace/lantern/graph/graph.prebundle.js +8 -0
- package/models/trace/lantern/graph/graph.prebundle.js.map +1 -0
- package/models/trace/lantern/graph/graph.prebundle.ts +8 -0
- package/models/trace/lantern/lantern.prebundle.d.ts +6 -0
- package/models/trace/lantern/lantern.prebundle.js +10 -0
- package/models/trace/lantern/lantern.prebundle.js.map +1 -0
- package/models/trace/lantern/lantern.prebundle.ts +17 -0
- package/models/trace/lantern/metrics/devtools_entrypoint-bundle-tsconfig-tsconfig.json +43 -0
- package/models/trace/lantern/metrics/metrics.prebundle.d.ts +8 -0
- package/models/trace/lantern/metrics/metrics.prebundle.js +12 -0
- package/models/trace/lantern/metrics/metrics.prebundle.js.map +1 -0
- package/models/trace/lantern/metrics/metrics.prebundle.ts +12 -0
- package/models/trace/lantern/simulation/Simulator.js +1 -1
- package/models/trace/lantern/simulation/Simulator.js.map +1 -1
- package/models/trace/lantern/simulation/devtools_entrypoint-bundle-tsconfig-tsconfig.json +43 -0
- package/models/trace/lantern/simulation/simulation.prebundle.d.ts +6 -0
- package/models/trace/lantern/simulation/simulation.prebundle.js +10 -0
- package/models/trace/lantern/simulation/simulation.prebundle.js.map +1 -0
- package/models/trace/lantern/simulation/simulation.prebundle.ts +10 -0
- package/models/trace/lantern/types/devtools_entrypoint-bundle-tsconfig-tsconfig.json +43 -0
- package/models/trace/lantern/types/types.prebundle.d.ts +1 -0
- package/models/trace/lantern/types/types.prebundle.js +5 -0
- package/models/trace/lantern/types/types.prebundle.js.map +1 -0
- package/models/trace/lantern/types/types.prebundle.ts +5 -0
- package/models/trace/trace-tsconfig.json +0 -1
- package/models/trace/trace.d.ts +1 -2
- package/models/trace/trace.js +1 -2
- package/models/trace/trace.js.map +1 -1
- package/models/trace/trace.prebundle.d.ts +10 -0
- package/models/trace/trace.prebundle.js +14 -0
- package/models/trace/trace.prebundle.js.map +1 -0
- package/models/trace/trace.prebundle.ts +25 -0
- package/models/trace/types/Extensions.d.ts +6 -1
- package/models/trace/types/Extensions.js.map +1 -1
- package/models/trace/types/File.d.ts +16 -1
- package/models/trace/types/File.js.map +1 -1
- package/models/trace/types/Timing.js.map +1 -1
- package/models/trace/types/TraceEvents.d.ts +7 -4
- package/models/trace/types/TraceEvents.js +4 -3
- package/models/trace/types/TraceEvents.js.map +1 -1
- package/models/trace/types/devtools_entrypoint-bundle-tsconfig-tsconfig.json +43 -0
- package/models/trace/types/types.prebundle.d.ts +5 -0
- package/models/trace/types/types.prebundle.js +9 -0
- package/models/trace/types/types.prebundle.js.map +1 -0
- package/models/trace/types/types.prebundle.ts +9 -0
- package/package.json +1 -1
- package/test/test-trace-engine.mjs +2 -2
- package/core/platform/ServerTiming.d.ts +0 -31
- package/core/platform/ServerTiming.js +0 -212
- package/core/platform/ServerTiming.js.map +0 -1
- package/models/trace/TracingManager.js.map +0 -1
- package/models/trace/extras/FetchNodes.d.ts +0 -61
- package/models/trace/extras/FetchNodes.js +0 -214
- package/models/trace/extras/FetchNodes.js.map +0 -1
- package/models/trace/extras/Metadata.d.ts +0 -3
- package/models/trace/extras/Metadata.js +0 -71
- package/models/trace/extras/Metadata.js.map +0 -1
- package/models/trace/extras/TimelineJSProfile.d.ts +0 -13
- package/models/trace/extras/TimelineJSProfile.js +0 -55
- package/models/trace/extras/TimelineJSProfile.js.map +0 -1
- package/models/trace/extras/URLForEntry.d.ts +0 -12
- package/models/trace/extras/URLForEntry.js +0 -43
- package/models/trace/extras/URLForEntry.js.map +0 -1
- package/models/trace/handlers/ServerTimingsHandler.d.ts +0 -9
- package/models/trace/handlers/ServerTimingsHandler.js +0 -106
- package/models/trace/handlers/ServerTimingsHandler.js.map +0 -1
- package/models/trace/insights/CumulativeLayoutShift.d.ts +0 -57
- package/models/trace/insights/CumulativeLayoutShift.js +0 -335
- package/models/trace/insights/CumulativeLayoutShift.js.map +0 -1
- package/models/trace/insights/InsightRunners.d.ts +0 -9
- package/models/trace/insights/InsightRunners.js +0 -13
- package/models/trace/insights/InsightRunners.js.map +0 -1
- package/models/trace/insights/InteractionToNextPaint.js.map +0 -1
- package/models/trace/insights/LCPPhases.js.map +0 -1
- package/models/trace/insights/LargestContentfulPaint.d.ts +0 -38
- package/models/trace/insights/LargestContentfulPaint.js +0 -113
- package/models/trace/insights/LargestContentfulPaint.js.map +0 -1
- package/models/trace/insights/ThirdPartyWeb.d.ts +0 -13
- package/models/trace/insights/ThirdPartyWeb.js +0 -42
- package/models/trace/insights/ThirdPartyWeb.js.map +0 -1
- package/models/trace/root-causes/LayoutShift.d.ts +0 -125
- package/models/trace/root-causes/LayoutShift.js +0 -519
- package/models/trace/root-causes/LayoutShift.js.map +0 -1
- package/models/trace/root-causes/RootCauses.d.ts +0 -15
- package/models/trace/root-causes/RootCauses.js +0 -12
- package/models/trace/root-causes/RootCauses.js.map +0 -1
- package/models/trace/root-causes/bundle-tsconfig.json +0 -1
- package/models/trace/root-causes/root-causes.d.ts +0 -1
- package/models/trace/root-causes/root-causes.js +0 -5
- package/models/trace/root-causes/root-causes.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Simulator.js","sourceRoot":"","sources":["../../../../../../../../front_end/models/trace/lantern/simulation/Simulator.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAG3C,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AACvC,OAAO,EAAiD,kBAAkB,EAAC,MAAM,0BAA0B,CAAC;AAC5G,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AAOjD,MAAM,iBAAiB,GAAG,SAAS,CAAC,UAAU,CAAC,YAAY,CAAC;AAE5D,6GAA6G;AAC7G,MAAM,mCAAmC,GAAG,EAAE,CAAC;AAC/C,6FAA6F;AAC7F,MAAM,8BAA8B,GAAG,GAAG,CAAC;AAC3C,gHAAgH;AAChH,MAAM,iCAAiC,GAAG,KAAK,CAAC;AAEhD,MAAM,SAAS,GAAG;IAChB,eAAe,EAAE,CAAC;IAClB,YAAY,EAAE,CAAC;IACf,UAAU,EAAE,CAAC;IACb,QAAQ,EAAE,CAAC;CACZ,C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AE,CAAC;YACxB,OAAO,IAAI,CAAC,SAAS,CAAC;QACxB,CAAC;QACD,OAAO,IAAI,CAAC,SAAS,GAAG,CAAC,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC;IAC/F,CAAC;CACF;AAED,OAAO,EAAC,SAAS,EAAC,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 * as Core from '../core/core.js';\nimport * as Graph from '../graph/graph.js';\nimport type * as Lantern from '../types/types.js';\n\nimport {ConnectionPool} from './ConnectionPool.js';\nimport {Constants} from './Constants.js';\nimport {DNSCache} from './DNSCache.js';\nimport {type CompleteNodeTiming, type ConnectionTiming, SimulatorTimingMap} from './SimulationTimingMap.js';\nimport {TCPConnection} from './TCPConnection.js';\n\nexport interface Result<T = Lantern.AnyNetworkObject> {\n timeInMs: number;\n nodeTimings: Map<Graph.Node<T>, Lantern.Simulation.NodeTiming>;\n}\n\nconst defaultThrottling = Constants.throttling.mobileSlow4G;\n\n// see https://cs.chromium.org/search/?q=kDefaultMaxNumDelayableRequestsPerClient&sq=package:chromium&type=cs\nconst DEFAULT_MAXIMUM_CONCURRENT_REQUESTS = 10;\n// layout tasks tend to be less CPU-bound and do not experience the same increase in duration\nconst DEFAULT_LAYOUT_TASK_MULTIPLIER = 0.5;\n// if a task takes more than 10 seconds it's usually a sign it isn't actually CPU bound and we're overestimating\nconst DEFAULT_MAXIMUM_CPU_TASK_DURATION = 10000;\n\nconst NodeState = {\n NotReadyToStart: 0,\n ReadyToStart: 1,\n InProgress: 2,\n Complete: 3,\n};\n\nconst PriorityStartTimePenalty: Record<Lantern.ResourcePriority, number> = {\n VeryHigh: 0,\n High: 0.25,\n Medium: 0.5,\n Low: 1,\n VeryLow: 2,\n};\n\nconst ALL_SIMULATION_NODE_TIMINGS = new Map<string, Map<Graph.Node, CompleteNodeTiming>>();\n\nclass Simulator<T = Lantern.AnyNetworkObject> {\n static createSimulator(settings: Lantern.Simulation.Settings): Simulator {\n const {throttlingMethod, throttling, precomputedLanternData, networkAnalysis} = settings;\n\n const options: Lantern.Simulation.Options = {\n additionalRttByOrigin: networkAnalysis.additionalRttByOrigin,\n serverResponseTimeByOrigin: networkAnalysis.serverResponseTimeByOrigin,\n observedThroughput: networkAnalysis.throughput,\n };\n\n // If we have precomputed lantern data, overwrite our observed estimates and use precomputed instead\n // for increased stability.\n if (precomputedLanternData) {\n options.additionalRttByOrigin = new Map(Object.entries(precomputedLanternData.additionalRttByOrigin));\n options.serverResponseTimeByOrigin = new Map(Object.entries(precomputedLanternData.serverResponseTimeByOrigin));\n }\n\n switch (throttlingMethod) {\n case 'provided':\n options.rtt = networkAnalysis.rtt;\n options.throughput = networkAnalysis.throughput;\n options.cpuSlowdownMultiplier = 1;\n options.layoutTaskMultiplier = 1;\n break;\n case 'devtools':\n if (throttling) {\n options.rtt = throttling.requestLatencyMs / Constants.throttling.DEVTOOLS_RTT_ADJUSTMENT_FACTOR;\n options.throughput =\n throttling.downloadThroughputKbps * 1024 / Constants.throttling.DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR;\n }\n\n options.cpuSlowdownMultiplier = 1;\n options.layoutTaskMultiplier = 1;\n break;\n case 'simulate':\n if (throttling) {\n options.rtt = throttling.rttMs;\n options.throughput = throttling.throughputKbps * 1024;\n options.cpuSlowdownMultiplier = throttling.cpuSlowdownMultiplier;\n }\n break;\n default:\n // intentionally fallback to simulator defaults\n break;\n }\n\n return new Simulator(options);\n }\n\n options: Required<Lantern.Simulation.Options>;\n _rtt: number;\n throughput: number;\n maximumConcurrentRequests: number;\n cpuSlowdownMultiplier: number;\n layoutTaskMultiplier: number;\n cachedNodeListByStartPosition: Graph.Node[];\n nodeTimings: SimulatorTimingMap;\n numberInProgressByType: Map<string, number>;\n nodes: Record<number, Set<Graph.Node>>;\n dns: DNSCache;\n connectionPool: ConnectionPool;\n\n constructor(options?: Lantern.Simulation.Options) {\n this.options = Object.assign(\n {\n rtt: defaultThrottling.rttMs,\n throughput: defaultThrottling.throughputKbps * 1024,\n maximumConcurrentRequests: DEFAULT_MAXIMUM_CONCURRENT_REQUESTS,\n cpuSlowdownMultiplier: defaultThrottling.cpuSlowdownMultiplier,\n layoutTaskMultiplier: DEFAULT_LAYOUT_TASK_MULTIPLIER,\n additionalRttByOrigin: new Map(),\n serverResponseTimeByOrigin: new Map(),\n },\n options,\n );\n\n this._rtt = this.options.rtt;\n this.throughput = this.options.throughput;\n this.maximumConcurrentRequests = Math.max(\n Math.min(\n TCPConnection.maximumSaturatedConnections(this._rtt, this.throughput),\n this.options.maximumConcurrentRequests,\n ),\n 1);\n this.cpuSlowdownMultiplier = this.options.cpuSlowdownMultiplier;\n this.layoutTaskMultiplier = this.cpuSlowdownMultiplier * this.options.layoutTaskMultiplier;\n this.cachedNodeListByStartPosition = [];\n\n // Properties reset on every `.simulate` call but duplicated here for type checking\n this.nodeTimings = new SimulatorTimingMap();\n this.numberInProgressByType = new Map<string, number>();\n this.nodes = {};\n this.dns = new DNSCache({rtt: this._rtt});\n // @ts-expect-error\n this.connectionPool = null;\n\n if (!Number.isFinite(this._rtt)) {\n throw new Core.LanternError(`Invalid rtt ${this._rtt}`);\n }\n if (!Number.isFinite(this.throughput)) {\n throw new Core.LanternError(`Invalid throughput ${this.throughput}`);\n }\n }\n\n get rtt(): number {\n return this._rtt;\n }\n\n initializeConnectionPool(graph: Graph.Node): void {\n const records: Lantern.NetworkRequest[] = [];\n graph.getRootNode().traverse(node => {\n if (node.type === Graph.BaseNode.types.NETWORK) {\n records.push(node.request);\n }\n });\n\n this.connectionPool = new ConnectionPool(records, this.options);\n }\n\n /**\n * Initializes the various state data structures such _nodeTimings and the _node Sets by state.\n */\n initializeAuxiliaryData(): void {\n this.nodeTimings = new SimulatorTimingMap();\n this.numberInProgressByType = new Map();\n\n this.nodes = {};\n this.cachedNodeListByStartPosition = [];\n // NOTE: We don't actually need *all* of these sets, but the clarity that each node progresses\n // through the system is quite nice.\n for (const state of Object.values(NodeState)) {\n this.nodes[state] = new Set();\n }\n }\n\n numberInProgress(type: string): number {\n return this.numberInProgressByType.get(type) || 0;\n }\n\n markNodeAsReadyToStart(node: Graph.Node, queuedTime: number): void {\n const nodeStartPosition = Simulator.computeNodeStartPosition(node);\n const firstNodeIndexWithGreaterStartPosition = this.cachedNodeListByStartPosition.findIndex(\n candidate => Simulator.computeNodeStartPosition(candidate) > nodeStartPosition);\n const insertionIndex = firstNodeIndexWithGreaterStartPosition === -1 ? this.cachedNodeListByStartPosition.length :\n firstNodeIndexWithGreaterStartPosition;\n this.cachedNodeListByStartPosition.splice(insertionIndex, 0, node);\n\n this.nodes[NodeState.ReadyToStart].add(node);\n this.nodes[NodeState.NotReadyToStart].delete(node);\n this.nodeTimings.setReadyToStart(node, {queuedTime});\n }\n\n markNodeAsInProgress(node: Graph.Node, startTime: number): void {\n const indexOfNodeToStart = this.cachedNodeListByStartPosition.indexOf(node);\n this.cachedNodeListByStartPosition.splice(indexOfNodeToStart, 1);\n\n this.nodes[NodeState.InProgress].add(node);\n this.nodes[NodeState.ReadyToStart].delete(node);\n this.numberInProgressByType.set(node.type, this.numberInProgress(node.type) + 1);\n this.nodeTimings.setInProgress(node, {startTime});\n }\n\n markNodeAsComplete(node: Graph.Node, endTime: number, connectionTiming?: ConnectionTiming): void {\n this.nodes[NodeState.Complete].add(node);\n this.nodes[NodeState.InProgress].delete(node);\n this.numberInProgressByType.set(node.type, this.numberInProgress(node.type) - 1);\n this.nodeTimings.setCompleted(node, {endTime, connectionTiming});\n\n // Try to add all its dependents to the queue\n for (const dependent of node.getDependents()) {\n // Skip dependent node if one of its dependencies hasn't finished yet\n const dependencies = dependent.getDependencies();\n if (dependencies.some(dep => !this.nodes[NodeState.Complete].has(dep))) {\n continue;\n }\n\n // Otherwise add it to the queue\n this.markNodeAsReadyToStart(dependent, endTime);\n }\n }\n\n acquireConnection(request: Lantern.NetworkRequest): TCPConnection|null {\n return this.connectionPool.acquire(request);\n }\n\n getNodesSortedByStartPosition(): Graph.Node[] {\n // Make a copy so we don't skip nodes due to concurrent modification\n return Array.from(this.cachedNodeListByStartPosition);\n }\n\n startNodeIfPossible(node: Graph.Node, totalElapsedTime: number): void {\n if (node.type === Graph.BaseNode.types.CPU) {\n // Start a CPU task if there's no other CPU task in process\n if (this.numberInProgress(node.type) === 0) {\n this.markNodeAsInProgress(node, totalElapsedTime);\n }\n\n return;\n }\n\n if (node.type !== Graph.BaseNode.types.NETWORK) {\n throw new Core.LanternError('Unsupported');\n }\n\n // If a network request is connectionless, we can always start it, so skip the connection checks\n if (!node.isConnectionless) {\n // Start a network request if we're not at max requests and a connection is available\n const numberOfActiveRequests = this.numberInProgress(node.type);\n if (numberOfActiveRequests >= this.maximumConcurrentRequests) {\n return;\n }\n const connection = this.acquireConnection(node.request);\n if (!connection) {\n return;\n }\n }\n\n this.markNodeAsInProgress(node, totalElapsedTime);\n }\n\n /**\n * Updates each connection in use with the available throughput based on the number of network requests\n * currently in flight.\n */\n updateNetworkCapacity(): void {\n const inFlight = this.numberInProgress(Graph.BaseNode.types.NETWORK);\n if (inFlight === 0) {\n return;\n }\n\n for (const connection of this.connectionPool.connectionsInUse()) {\n connection.setThroughput(this.throughput / inFlight);\n }\n }\n\n /**\n * Estimates the number of milliseconds remaining given current conditions before the node is complete.\n */\n estimateTimeRemaining(node: Graph.Node): number {\n if (node.type === Graph.BaseNode.types.CPU) {\n return this.estimateCPUTimeRemaining(node);\n }\n if (node.type === Graph.BaseNode.types.NETWORK) {\n return this.estimateNetworkTimeRemaining(node);\n }\n throw new Core.LanternError('Unsupported');\n }\n\n estimateCPUTimeRemaining(cpuNode: Graph.CPUNode): number {\n const timingData = this.nodeTimings.getCpuStarted(cpuNode);\n const multiplier = cpuNode.didPerformLayout() ? this.layoutTaskMultiplier : this.cpuSlowdownMultiplier;\n const totalDuration = Math.min(\n Math.round(cpuNode.duration / 1000 * multiplier),\n DEFAULT_MAXIMUM_CPU_TASK_DURATION,\n );\n const estimatedTimeElapsed = totalDuration - timingData.timeElapsed;\n this.nodeTimings.setCpuEstimated(cpuNode, {estimatedTimeElapsed});\n return estimatedTimeElapsed;\n }\n\n estimateNetworkTimeRemaining(networkNode: Graph.NetworkNode): number {\n const request = networkNode.request;\n const timingData = this.nodeTimings.getNetworkStarted(networkNode);\n\n let timeElapsed = 0;\n if (networkNode.fromDiskCache) {\n // Rough access time for seeking to location on disk and reading sequentially.\n // 8ms per seek + 20ms/MB\n // @see http://norvig.com/21-days.html#answers\n const sizeInMb = (request.resourceSize || 0) / 1024 / 1024;\n timeElapsed = 8 + 20 * sizeInMb - timingData.timeElapsed;\n } else if (networkNode.isNonNetworkProtocol) {\n // Estimates for the overhead of a data URL in Chromium and the decoding time for base64-encoded data.\n // 2ms per request + 10ms/MB\n // @see traces on https://dopiaza.org/tools/datauri/examples/index.php\n const sizeInMb = (request.resourceSize || 0) / 1024 / 1024;\n timeElapsed = 2 + 10 * sizeInMb - timingData.timeElapsed;\n } else {\n const connection = this.connectionPool.acquireActiveConnectionFromRequest(request);\n const dnsResolutionTime = this.dns.getTimeUntilResolution(request, {\n requestedAt: timingData.startTime,\n shouldUpdateCache: true,\n });\n const timeAlreadyElapsed = timingData.timeElapsed;\n const calculation = connection.simulateDownloadUntil(\n request.transferSize - timingData.bytesDownloaded,\n {timeAlreadyElapsed, dnsResolutionTime, maximumTimeToElapse: Infinity},\n );\n\n timeElapsed = calculation.timeElapsed;\n }\n\n const estimatedTimeElapsed = timeElapsed + timingData.timeElapsedOvershoot;\n this.nodeTimings.setNetworkEstimated(networkNode, {estimatedTimeElapsed});\n return estimatedTimeElapsed;\n }\n\n /**\n * Computes and returns the minimum estimated completion time of the nodes currently in progress.\n */\n findNextNodeCompletionTime(): number {\n let minimumTime = Infinity;\n for (const node of this.nodes[NodeState.InProgress]) {\n minimumTime = Math.min(minimumTime, this.estimateTimeRemaining(node));\n }\n\n return minimumTime;\n }\n\n /**\n * Given a time period, computes the progress toward completion that the node made during that time.\n */\n updateProgressMadeInTimePeriod(node: Graph.Node, timePeriodLength: number, totalElapsedTime: number): void {\n const timingData = this.nodeTimings.getInProgress(node);\n const isFinished = timingData.estimatedTimeElapsed === timePeriodLength;\n\n if (node.type === Graph.BaseNode.types.CPU || node.isConnectionless) {\n if (isFinished) {\n this.markNodeAsComplete(node, totalElapsedTime);\n } else {\n timingData.timeElapsed += timePeriodLength;\n }\n return;\n }\n\n if (node.type !== Graph.BaseNode.types.NETWORK) {\n throw new Core.LanternError('Unsupported');\n }\n if (!('bytesDownloaded' in timingData)) {\n throw new Core.LanternError('Invalid timing data');\n }\n\n const request = node.request;\n const connection = this.connectionPool.acquireActiveConnectionFromRequest(request);\n const dnsResolutionTime = this.dns.getTimeUntilResolution(request, {\n requestedAt: timingData.startTime,\n shouldUpdateCache: true,\n });\n const calculation = connection.simulateDownloadUntil(\n request.transferSize - timingData.bytesDownloaded,\n {\n dnsResolutionTime,\n timeAlreadyElapsed: timingData.timeElapsed,\n maximumTimeToElapse: timePeriodLength - timingData.timeElapsedOvershoot,\n },\n );\n\n connection.setCongestionWindow(calculation.congestionWindow);\n connection.setH2OverflowBytesDownloaded(calculation.extraBytesDownloaded);\n\n if (isFinished) {\n connection.setWarmed(true);\n this.connectionPool.release(request);\n this.markNodeAsComplete(node, totalElapsedTime, calculation.connectionTiming);\n } else {\n timingData.timeElapsed += calculation.timeElapsed;\n timingData.timeElapsedOvershoot += calculation.timeElapsed - timePeriodLength;\n timingData.bytesDownloaded += calculation.bytesDownloaded;\n }\n }\n\n computeFinalNodeTimings(): {\n nodeTimings: Map<Graph.Node, Lantern.Simulation.NodeTiming>,\n completeNodeTimings: Map<Graph.Node, CompleteNodeTiming>,\n } {\n const completeNodeTimingEntries: Array<[Graph.Node, CompleteNodeTiming]> = this.nodeTimings.getNodes().map(node => {\n return [node, this.nodeTimings.getCompleted(node)];\n });\n\n // Most consumers will want the entries sorted by startTime, so insert them in that order\n completeNodeTimingEntries.sort((a, b) => a[1].startTime - b[1].startTime);\n\n // Trimmed version of type `Lantern.Simulation.NodeTiming`.\n const nodeTimingEntries: Array<[Graph.Node, Lantern.Simulation.NodeTiming]> =\n completeNodeTimingEntries.map(([node, timing]) => {\n return [\n node,\n {\n startTime: timing.startTime,\n endTime: timing.endTime,\n duration: timing.endTime - timing.startTime,\n },\n ];\n });\n\n return {\n nodeTimings: new Map(nodeTimingEntries),\n completeNodeTimings: new Map(completeNodeTimingEntries),\n };\n }\n\n getOptions(): Required<Lantern.Simulation.Options> {\n return this.options;\n }\n\n /**\n * Estimates the time taken to process all of the graph's nodes, returns the overall time along with\n * each node annotated by start/end times.\n *\n * Simulator/connection pool are allowed to deviate from what was\n * observed in the trace/devtoolsLog and start requests as soon as they are queued (i.e. do not\n * wait around for a warm connection to be available if the original request was fetched on a warm\n * connection).\n */\n simulate(graph: Graph.Node, options?: {label?: string}): Result<T> {\n if (Graph.BaseNode.hasCycle(graph)) {\n throw new Core.LanternError('Cannot simulate graph with cycle');\n }\n\n options = Object.assign(\n {\n label: undefined,\n },\n options);\n\n // initialize the necessary data containers\n this.dns = new DNSCache({rtt: this._rtt});\n this.initializeConnectionPool(graph);\n this.initializeAuxiliaryData();\n\n const nodesNotReadyToStart = this.nodes[NodeState.NotReadyToStart];\n const nodesReadyToStart = this.nodes[NodeState.ReadyToStart];\n const nodesInProgress = this.nodes[NodeState.InProgress];\n\n const rootNode = graph.getRootNode();\n rootNode.traverse(node => nodesNotReadyToStart.add(node));\n let totalElapsedTime = 0;\n let iteration = 0;\n\n // root node is always ready to start\n this.markNodeAsReadyToStart(rootNode, totalElapsedTime);\n\n // loop as long as we have nodes in the queue or currently in progress\n while (nodesReadyToStart.size || nodesInProgress.size) {\n // move all possible queued nodes to in progress\n for (const node of this.getNodesSortedByStartPosition()) {\n this.startNodeIfPossible(node, totalElapsedTime);\n }\n\n if (!nodesInProgress.size) {\n // Interplay between fromDiskCache and connectionReused can be incorrect,\n // have to give up.\n throw new Core.LanternError('Failed to start a node');\n }\n\n // set the available throughput for all connections based on # in-flight\n this.updateNetworkCapacity();\n\n // find the time that the next node will finish\n const minimumTime = this.findNextNodeCompletionTime();\n totalElapsedTime += minimumTime;\n\n // While this is no longer strictly necessary, it's always better than hanging\n if (!Number.isFinite(minimumTime) || iteration > 100000) {\n throw new Core.LanternError('Simulation failed, depth exceeded');\n }\n\n iteration++;\n // update how far each node will progress until that point\n for (const node of nodesInProgress) {\n this.updateProgressMadeInTimePeriod(node, minimumTime, totalElapsedTime);\n }\n }\n\n // `nodeTimings` are used for simulator consumers, `completeNodeTimings` kept for debugging.\n const {nodeTimings, completeNodeTimings} = this.computeFinalNodeTimings();\n ALL_SIMULATION_NODE_TIMINGS.set(options.label || 'unlabeled', completeNodeTimings);\n\n return {\n timeInMs: totalElapsedTime,\n nodeTimings,\n };\n }\n\n computeWastedMsFromWastedBytes(wastedBytes: number): number {\n const {throughput, observedThroughput} = this.options;\n\n // https://github.com/GoogleChrome/lighthouse/pull/13323#issuecomment-962031709\n // 0 throughput means the no (additional) throttling is expected.\n // This is common for desktop + devtools throttling where throttling is additive and we don't want any additional.\n const bitsPerSecond = throughput === 0 ? observedThroughput : throughput;\n if (bitsPerSecond === 0) {\n return 0;\n }\n\n const wastedBits = wastedBytes * 8;\n const wastedMs = wastedBits / bitsPerSecond * 1000;\n\n // This is an estimate of wasted time, so we won't be more precise than 10ms.\n return Math.round(wastedMs / 10) * 10;\n }\n\n // Used by Lighthouse asset-saver\n static get allNodeTimings(): Map<string, Map<Graph.Node, CompleteNodeTiming>> {\n return ALL_SIMULATION_NODE_TIMINGS;\n }\n\n /**\n * We attempt to start nodes by their observed start time using the request priority as a tie breaker.\n * When simulating, just because a low priority image started 5ms before a high priority image doesn't mean\n * it would have happened like that when the network was slower.\n */\n static computeNodeStartPosition(node: Graph.Node): number {\n if (node.type === 'cpu') {\n return node.startTime;\n }\n return node.startTime + (PriorityStartTimePenalty[node.request.priority] * 1000 * 1000 || 0);\n }\n}\n\nexport {Simulator};\n"]}
|
|
1
|
+
{"version":3,"file":"Simulator.js","sourceRoot":"","sources":["../../../../../../../../front_end/models/trace/lantern/simulation/Simulator.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAG3C,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AACvC,OAAO,EAAiD,kBAAkB,EAAC,MAAM,0BAA0B,CAAC;AAC5G,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AAOjD,MAAM,iBAAiB,GAAG,SAAS,CAAC,UAAU,CAAC,YAAY,CAAC;AAE5D,6GAA6G;AAC7G,MAAM,mCAAmC,GAAG,EAAE,CAAC;AAC/C,6FAA6F;AAC7F,MAAM,8BAA8B,GAAG,GAAG,CAAC;AAC3C,gHAAgH;AAChH,MAAM,iCAAiC,GAAG,KAAK,CAAC;AAEhD,MAAM,SAAS,GAAG;IAChB,eAAe,EAAE,CAAC;IAClB,YAAY,EAAE,CAAC;IACf,UAAU,EAAE,CAAC;IACb,QAAQ,EAAE,CAAC;CACZ,CAAC;AAEF,MAAM,wBAAwB,GAA6C;IACzE,QAAQ,EAAE,CAAC;IACX,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,GAAG;IACX,GAAG,EAAE,CAAC;IACN,OAAO,EAAE,CAAC;CACX,CAAC;AAEF,MAAM,2BAA2B,GAAG,IAAI,GAAG,EAA+C,CAAC;AAE3F,MAAM,SAAS;IACb,MAAM,CAAC,eAAe,CAAC,QAAqC;QAC1D,MAAM,EAAC,gBAAgB,EAAE,UAAU,EAAE,sBA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,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAC1E,2BAA2B,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,IAAI,WAAW,EAAE,mBAAmB,CAAC,CAAC;QAEnF,OAAO;YACL,QAAQ,EAAE,gBAAgB;YAC1B,WAAW;SACZ,CAAC;IACJ,CAAC;IAED,8BAA8B,CAAC,WAAmB;QAChD,MAAM,EAAC,UAAU,EAAE,kBAAkB,EAAC,GAAG,IAAI,CAAC,OAAO,CAAC;QAEtD,+EAA+E;QAC/E,iEAAiE;QACjE,kHAAkH;QAClH,MAAM,aAAa,GAAG,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,UAAU,CAAC;QACzE,IAAI,aAAa,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,CAAC,CAAC;QACX,CAAC;QAED,MAAM,UAAU,GAAG,WAAW,GAAG,CAAC,CAAC;QACnC,MAAM,QAAQ,GAAG,UAAU,GAAG,aAAa,GAAG,IAAI,CAAC;QAEnD,6EAA6E;QAC7E,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC;IACxC,CAAC;IAED,iCAAiC;IACjC,MAAM,KAAK,cAAc;QACvB,OAAO,2BAA2B,CAAC;IACrC,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,wBAAwB,CAAC,IAAgB;QAC9C,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;YACxB,OAAO,IAAI,CAAC,SAAS,CAAC;QACxB,CAAC;QACD,OAAO,IAAI,CAAC,SAAS,GAAG,CAAC,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC;IAC/F,CAAC;CACF;AAED,OAAO,EAAC,SAAS,EAAC,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 * as Core from '../core/core.js';\nimport * as Graph from '../graph/graph.js';\nimport type * as Lantern from '../types/types.js';\n\nimport {ConnectionPool} from './ConnectionPool.js';\nimport {Constants} from './Constants.js';\nimport {DNSCache} from './DNSCache.js';\nimport {type CompleteNodeTiming, type ConnectionTiming, SimulatorTimingMap} from './SimulationTimingMap.js';\nimport {TCPConnection} from './TCPConnection.js';\n\nexport interface Result<T = Lantern.AnyNetworkObject> {\n timeInMs: number;\n nodeTimings: Map<Graph.Node<T>, Lantern.Simulation.NodeTiming>;\n}\n\nconst defaultThrottling = Constants.throttling.mobileSlow4G;\n\n// see https://cs.chromium.org/search/?q=kDefaultMaxNumDelayableRequestsPerClient&sq=package:chromium&type=cs\nconst DEFAULT_MAXIMUM_CONCURRENT_REQUESTS = 10;\n// layout tasks tend to be less CPU-bound and do not experience the same increase in duration\nconst DEFAULT_LAYOUT_TASK_MULTIPLIER = 0.5;\n// if a task takes more than 10 seconds it's usually a sign it isn't actually CPU bound and we're overestimating\nconst DEFAULT_MAXIMUM_CPU_TASK_DURATION = 10000;\n\nconst NodeState = {\n NotReadyToStart: 0,\n ReadyToStart: 1,\n InProgress: 2,\n Complete: 3,\n};\n\nconst PriorityStartTimePenalty: Record<Lantern.ResourcePriority, number> = {\n VeryHigh: 0,\n High: 0.25,\n Medium: 0.5,\n Low: 1,\n VeryLow: 2,\n};\n\nconst ALL_SIMULATION_NODE_TIMINGS = new Map<string, Map<Graph.Node, CompleteNodeTiming>>();\n\nclass Simulator<T = Lantern.AnyNetworkObject> {\n static createSimulator(settings: Lantern.Simulation.Settings): Simulator {\n const {throttlingMethod, throttling, precomputedLanternData, networkAnalysis} = settings;\n\n const options: Lantern.Simulation.Options = {\n additionalRttByOrigin: networkAnalysis.additionalRttByOrigin,\n serverResponseTimeByOrigin: networkAnalysis.serverResponseTimeByOrigin,\n observedThroughput: networkAnalysis.throughput,\n };\n\n // If we have precomputed lantern data, overwrite our observed estimates and use precomputed instead\n // for increased stability.\n if (precomputedLanternData) {\n options.additionalRttByOrigin = new Map(Object.entries(precomputedLanternData.additionalRttByOrigin));\n options.serverResponseTimeByOrigin = new Map(Object.entries(precomputedLanternData.serverResponseTimeByOrigin));\n }\n\n switch (throttlingMethod) {\n case 'provided':\n options.rtt = networkAnalysis.rtt;\n options.throughput = networkAnalysis.throughput;\n options.cpuSlowdownMultiplier = 1;\n options.layoutTaskMultiplier = 1;\n break;\n case 'devtools':\n if (throttling) {\n options.rtt = throttling.requestLatencyMs / Constants.throttling.DEVTOOLS_RTT_ADJUSTMENT_FACTOR;\n options.throughput =\n throttling.downloadThroughputKbps * 1024 / Constants.throttling.DEVTOOLS_THROUGHPUT_ADJUSTMENT_FACTOR;\n }\n\n options.cpuSlowdownMultiplier = 1;\n options.layoutTaskMultiplier = 1;\n break;\n case 'simulate':\n if (throttling) {\n options.rtt = throttling.rttMs;\n options.throughput = throttling.throughputKbps * 1024;\n options.cpuSlowdownMultiplier = throttling.cpuSlowdownMultiplier;\n }\n break;\n default:\n // intentionally fallback to simulator defaults\n break;\n }\n\n return new Simulator(options);\n }\n\n options: Required<Lantern.Simulation.Options>;\n _rtt: number;\n throughput: number;\n maximumConcurrentRequests: number;\n cpuSlowdownMultiplier: number;\n layoutTaskMultiplier: number;\n cachedNodeListByStartPosition: Graph.Node[];\n nodeTimings: SimulatorTimingMap;\n numberInProgressByType: Map<string, number>;\n nodes: Record<number, Set<Graph.Node>>;\n dns: DNSCache;\n connectionPool: ConnectionPool;\n\n constructor(options?: Lantern.Simulation.Options) {\n this.options = Object.assign(\n {\n rtt: defaultThrottling.rttMs,\n throughput: defaultThrottling.throughputKbps * 1024,\n maximumConcurrentRequests: DEFAULT_MAXIMUM_CONCURRENT_REQUESTS,\n cpuSlowdownMultiplier: defaultThrottling.cpuSlowdownMultiplier,\n layoutTaskMultiplier: DEFAULT_LAYOUT_TASK_MULTIPLIER,\n additionalRttByOrigin: new Map(),\n serverResponseTimeByOrigin: new Map(),\n },\n options,\n );\n\n this._rtt = this.options.rtt;\n this.throughput = this.options.throughput;\n this.maximumConcurrentRequests = Math.max(\n Math.min(\n TCPConnection.maximumSaturatedConnections(this._rtt, this.throughput),\n this.options.maximumConcurrentRequests,\n ),\n 1);\n this.cpuSlowdownMultiplier = this.options.cpuSlowdownMultiplier;\n this.layoutTaskMultiplier = this.cpuSlowdownMultiplier * this.options.layoutTaskMultiplier;\n this.cachedNodeListByStartPosition = [];\n\n // Properties reset on every `.simulate` call but duplicated here for type checking\n this.nodeTimings = new SimulatorTimingMap();\n this.numberInProgressByType = new Map<string, number>();\n this.nodes = {};\n this.dns = new DNSCache({rtt: this._rtt});\n // @ts-expect-error\n this.connectionPool = null;\n\n if (!Number.isFinite(this._rtt)) {\n throw new Core.LanternError(`Invalid rtt ${this._rtt}`);\n }\n if (!Number.isFinite(this.throughput)) {\n throw new Core.LanternError(`Invalid throughput ${this.throughput}`);\n }\n }\n\n get rtt(): number {\n return this._rtt;\n }\n\n initializeConnectionPool(graph: Graph.Node): void {\n const records: Lantern.NetworkRequest[] = [];\n graph.getRootNode().traverse(node => {\n if (node.type === Graph.BaseNode.types.NETWORK) {\n records.push(node.request);\n }\n });\n\n this.connectionPool = new ConnectionPool(records, this.options);\n }\n\n /**\n * Initializes the various state data structures such _nodeTimings and the _node Sets by state.\n */\n initializeAuxiliaryData(): void {\n this.nodeTimings = new SimulatorTimingMap();\n this.numberInProgressByType = new Map();\n\n this.nodes = {};\n this.cachedNodeListByStartPosition = [];\n // NOTE: We don't actually need *all* of these sets, but the clarity that each node progresses\n // through the system is quite nice.\n for (const state of Object.values(NodeState)) {\n this.nodes[state] = new Set();\n }\n }\n\n numberInProgress(type: string): number {\n return this.numberInProgressByType.get(type) || 0;\n }\n\n markNodeAsReadyToStart(node: Graph.Node, queuedTime: number): void {\n const nodeStartPosition = Simulator.computeNodeStartPosition(node);\n const firstNodeIndexWithGreaterStartPosition = this.cachedNodeListByStartPosition.findIndex(\n candidate => Simulator.computeNodeStartPosition(candidate) > nodeStartPosition);\n const insertionIndex = firstNodeIndexWithGreaterStartPosition === -1 ? this.cachedNodeListByStartPosition.length :\n firstNodeIndexWithGreaterStartPosition;\n this.cachedNodeListByStartPosition.splice(insertionIndex, 0, node);\n\n this.nodes[NodeState.ReadyToStart].add(node);\n this.nodes[NodeState.NotReadyToStart].delete(node);\n this.nodeTimings.setReadyToStart(node, {queuedTime});\n }\n\n markNodeAsInProgress(node: Graph.Node, startTime: number): void {\n const indexOfNodeToStart = this.cachedNodeListByStartPosition.indexOf(node);\n this.cachedNodeListByStartPosition.splice(indexOfNodeToStart, 1);\n\n this.nodes[NodeState.InProgress].add(node);\n this.nodes[NodeState.ReadyToStart].delete(node);\n this.numberInProgressByType.set(node.type, this.numberInProgress(node.type) + 1);\n this.nodeTimings.setInProgress(node, {startTime});\n }\n\n markNodeAsComplete(node: Graph.Node, endTime: number, connectionTiming?: ConnectionTiming): void {\n this.nodes[NodeState.Complete].add(node);\n this.nodes[NodeState.InProgress].delete(node);\n this.numberInProgressByType.set(node.type, this.numberInProgress(node.type) - 1);\n this.nodeTimings.setCompleted(node, {endTime, connectionTiming});\n\n // Try to add all its dependents to the queue\n for (const dependent of node.getDependents()) {\n // Skip dependent node if one of its dependencies hasn't finished yet\n const dependencies = dependent.getDependencies();\n if (dependencies.some(dep => !this.nodes[NodeState.Complete].has(dep))) {\n continue;\n }\n\n // Otherwise add it to the queue\n this.markNodeAsReadyToStart(dependent, endTime);\n }\n }\n\n acquireConnection(request: Lantern.NetworkRequest): TCPConnection|null {\n return this.connectionPool.acquire(request);\n }\n\n getNodesSortedByStartPosition(): Graph.Node[] {\n // Make a copy so we don't skip nodes due to concurrent modification\n return Array.from(this.cachedNodeListByStartPosition);\n }\n\n startNodeIfPossible(node: Graph.Node, totalElapsedTime: number): void {\n if (node.type === Graph.BaseNode.types.CPU) {\n // Start a CPU task if there's no other CPU task in process\n if (this.numberInProgress(node.type) === 0) {\n this.markNodeAsInProgress(node, totalElapsedTime);\n }\n\n return;\n }\n\n if (node.type !== Graph.BaseNode.types.NETWORK) {\n throw new Core.LanternError('Unsupported');\n }\n\n // If a network request is connectionless, we can always start it, so skip the connection checks\n if (!node.isConnectionless) {\n // Start a network request if we're not at max requests and a connection is available\n const numberOfActiveRequests = this.numberInProgress(node.type);\n if (numberOfActiveRequests >= this.maximumConcurrentRequests) {\n return;\n }\n const connection = this.acquireConnection(node.request);\n if (!connection) {\n return;\n }\n }\n\n this.markNodeAsInProgress(node, totalElapsedTime);\n }\n\n /**\n * Updates each connection in use with the available throughput based on the number of network requests\n * currently in flight.\n */\n updateNetworkCapacity(): void {\n const inFlight = this.numberInProgress(Graph.BaseNode.types.NETWORK);\n if (inFlight === 0) {\n return;\n }\n\n for (const connection of this.connectionPool.connectionsInUse()) {\n connection.setThroughput(this.throughput / inFlight);\n }\n }\n\n /**\n * Estimates the number of milliseconds remaining given current conditions before the node is complete.\n */\n estimateTimeRemaining(node: Graph.Node): number {\n if (node.type === Graph.BaseNode.types.CPU) {\n return this.estimateCPUTimeRemaining(node);\n }\n if (node.type === Graph.BaseNode.types.NETWORK) {\n return this.estimateNetworkTimeRemaining(node);\n }\n throw new Core.LanternError('Unsupported');\n }\n\n estimateCPUTimeRemaining(cpuNode: Graph.CPUNode): number {\n const timingData = this.nodeTimings.getCpuStarted(cpuNode);\n const multiplier = cpuNode.didPerformLayout() ? this.layoutTaskMultiplier : this.cpuSlowdownMultiplier;\n const totalDuration = Math.min(\n Math.round(cpuNode.duration / 1000 * multiplier),\n DEFAULT_MAXIMUM_CPU_TASK_DURATION,\n );\n const estimatedTimeElapsed = totalDuration - timingData.timeElapsed;\n this.nodeTimings.setCpuEstimated(cpuNode, {estimatedTimeElapsed});\n return estimatedTimeElapsed;\n }\n\n estimateNetworkTimeRemaining(networkNode: Graph.NetworkNode): number {\n const request = networkNode.request;\n const timingData = this.nodeTimings.getNetworkStarted(networkNode);\n\n let timeElapsed = 0;\n if (networkNode.fromDiskCache) {\n // Rough access time for seeking to location on disk and reading sequentially.\n // 8ms per seek + 20ms/MB\n // @see http://norvig.com/21-days.html#answers\n const sizeInMb = (request.resourceSize || 0) / 1024 / 1024;\n timeElapsed = 8 + 20 * sizeInMb - timingData.timeElapsed;\n } else if (networkNode.isNonNetworkProtocol) {\n // Estimates for the overhead of a data URL in Chromium and the decoding time for base64-encoded data.\n // 2ms per request + 10ms/MB\n // @see traces on https://dopiaza.org/tools/datauri/examples/index.php\n const sizeInMb = (request.resourceSize || 0) / 1024 / 1024;\n timeElapsed = 2 + 10 * sizeInMb - timingData.timeElapsed;\n } else {\n const connection = this.connectionPool.acquireActiveConnectionFromRequest(request);\n const dnsResolutionTime = this.dns.getTimeUntilResolution(request, {\n requestedAt: timingData.startTime,\n shouldUpdateCache: true,\n });\n const timeAlreadyElapsed = timingData.timeElapsed;\n const calculation = connection.simulateDownloadUntil(\n request.transferSize - timingData.bytesDownloaded,\n {timeAlreadyElapsed, dnsResolutionTime, maximumTimeToElapse: Infinity},\n );\n\n timeElapsed = calculation.timeElapsed;\n }\n\n const estimatedTimeElapsed = timeElapsed + timingData.timeElapsedOvershoot;\n this.nodeTimings.setNetworkEstimated(networkNode, {estimatedTimeElapsed});\n return estimatedTimeElapsed;\n }\n\n /**\n * Computes and returns the minimum estimated completion time of the nodes currently in progress.\n */\n findNextNodeCompletionTime(): number {\n let minimumTime = Infinity;\n for (const node of this.nodes[NodeState.InProgress]) {\n minimumTime = Math.min(minimumTime, this.estimateTimeRemaining(node));\n }\n\n return minimumTime;\n }\n\n /**\n * Given a time period, computes the progress toward completion that the node made during that time.\n */\n updateProgressMadeInTimePeriod(node: Graph.Node, timePeriodLength: number, totalElapsedTime: number): void {\n const timingData = this.nodeTimings.getInProgress(node);\n const isFinished = timingData.estimatedTimeElapsed === timePeriodLength;\n\n if (node.type === Graph.BaseNode.types.CPU || node.isConnectionless) {\n if (isFinished) {\n this.markNodeAsComplete(node, totalElapsedTime);\n } else {\n timingData.timeElapsed += timePeriodLength;\n }\n return;\n }\n\n if (node.type !== Graph.BaseNode.types.NETWORK) {\n throw new Core.LanternError('Unsupported');\n }\n if (!('bytesDownloaded' in timingData)) {\n throw new Core.LanternError('Invalid timing data');\n }\n\n const request = node.request;\n const connection = this.connectionPool.acquireActiveConnectionFromRequest(request);\n const dnsResolutionTime = this.dns.getTimeUntilResolution(request, {\n requestedAt: timingData.startTime,\n shouldUpdateCache: true,\n });\n const calculation = connection.simulateDownloadUntil(\n request.transferSize - timingData.bytesDownloaded,\n {\n dnsResolutionTime,\n timeAlreadyElapsed: timingData.timeElapsed,\n maximumTimeToElapse: timePeriodLength - timingData.timeElapsedOvershoot,\n },\n );\n\n connection.setCongestionWindow(calculation.congestionWindow);\n connection.setH2OverflowBytesDownloaded(calculation.extraBytesDownloaded);\n\n if (isFinished) {\n connection.setWarmed(true);\n this.connectionPool.release(request);\n this.markNodeAsComplete(node, totalElapsedTime, calculation.connectionTiming);\n } else {\n timingData.timeElapsed += calculation.timeElapsed;\n timingData.timeElapsedOvershoot += calculation.timeElapsed - timePeriodLength;\n timingData.bytesDownloaded += calculation.bytesDownloaded;\n }\n }\n\n computeFinalNodeTimings(): {\n nodeTimings: Map<Graph.Node, Lantern.Simulation.NodeTiming>,\n completeNodeTimings: Map<Graph.Node, CompleteNodeTiming>,\n } {\n const completeNodeTimingEntries: Array<[Graph.Node, CompleteNodeTiming]> = this.nodeTimings.getNodes().map(node => {\n return [node, this.nodeTimings.getCompleted(node)];\n });\n\n // Most consumers will want the entries sorted by startTime, so insert them in that order\n completeNodeTimingEntries.sort((a, b) => a[1].startTime - b[1].startTime);\n\n // Trimmed version of type `Lantern.Simulation.NodeTiming`.\n const nodeTimingEntries: Array<[Graph.Node, Lantern.Simulation.NodeTiming]> =\n completeNodeTimingEntries.map(([node, timing]) => {\n return [\n node,\n {\n startTime: timing.startTime,\n endTime: timing.endTime,\n duration: timing.endTime - timing.startTime,\n },\n ];\n });\n\n return {\n nodeTimings: new Map(nodeTimingEntries),\n completeNodeTimings: new Map(completeNodeTimingEntries),\n };\n }\n\n getOptions(): Required<Lantern.Simulation.Options> {\n return this.options;\n }\n\n /**\n * Estimates the time taken to process all of the graph's nodes, returns the overall time along with\n * each node annotated by start/end times.\n *\n * Simulator/connection pool are allowed to deviate from what was\n * observed in the trace/devtoolsLog and start requests as soon as they are queued (i.e. do not\n * wait around for a warm connection to be available if the original request was fetched on a warm\n * connection).\n */\n simulate(graph: Graph.Node, options?: {label?: string}): Result<T> {\n if (Graph.BaseNode.findCycle(graph)) {\n throw new Core.LanternError('Cannot simulate graph with cycle');\n }\n\n options = Object.assign(\n {\n label: undefined,\n },\n options);\n\n // initialize the necessary data containers\n this.dns = new DNSCache({rtt: this._rtt});\n this.initializeConnectionPool(graph);\n this.initializeAuxiliaryData();\n\n const nodesNotReadyToStart = this.nodes[NodeState.NotReadyToStart];\n const nodesReadyToStart = this.nodes[NodeState.ReadyToStart];\n const nodesInProgress = this.nodes[NodeState.InProgress];\n\n const rootNode = graph.getRootNode();\n rootNode.traverse(node => nodesNotReadyToStart.add(node));\n let totalElapsedTime = 0;\n let iteration = 0;\n\n // root node is always ready to start\n this.markNodeAsReadyToStart(rootNode, totalElapsedTime);\n\n // loop as long as we have nodes in the queue or currently in progress\n while (nodesReadyToStart.size || nodesInProgress.size) {\n // move all possible queued nodes to in progress\n for (const node of this.getNodesSortedByStartPosition()) {\n this.startNodeIfPossible(node, totalElapsedTime);\n }\n\n if (!nodesInProgress.size) {\n // Interplay between fromDiskCache and connectionReused can be incorrect,\n // have to give up.\n throw new Core.LanternError('Failed to start a node');\n }\n\n // set the available throughput for all connections based on # in-flight\n this.updateNetworkCapacity();\n\n // find the time that the next node will finish\n const minimumTime = this.findNextNodeCompletionTime();\n totalElapsedTime += minimumTime;\n\n // While this is no longer strictly necessary, it's always better than hanging\n if (!Number.isFinite(minimumTime) || iteration > 100000) {\n throw new Core.LanternError('Simulation failed, depth exceeded');\n }\n\n iteration++;\n // update how far each node will progress until that point\n for (const node of nodesInProgress) {\n this.updateProgressMadeInTimePeriod(node, minimumTime, totalElapsedTime);\n }\n }\n\n // `nodeTimings` are used for simulator consumers, `completeNodeTimings` kept for debugging.\n const {nodeTimings, completeNodeTimings} = this.computeFinalNodeTimings();\n ALL_SIMULATION_NODE_TIMINGS.set(options.label || 'unlabeled', completeNodeTimings);\n\n return {\n timeInMs: totalElapsedTime,\n nodeTimings,\n };\n }\n\n computeWastedMsFromWastedBytes(wastedBytes: number): number {\n const {throughput, observedThroughput} = this.options;\n\n // https://github.com/GoogleChrome/lighthouse/pull/13323#issuecomment-962031709\n // 0 throughput means the no (additional) throttling is expected.\n // This is common for desktop + devtools throttling where throttling is additive and we don't want any additional.\n const bitsPerSecond = throughput === 0 ? observedThroughput : throughput;\n if (bitsPerSecond === 0) {\n return 0;\n }\n\n const wastedBits = wastedBytes * 8;\n const wastedMs = wastedBits / bitsPerSecond * 1000;\n\n // This is an estimate of wasted time, so we won't be more precise than 10ms.\n return Math.round(wastedMs / 10) * 10;\n }\n\n // Used by Lighthouse asset-saver\n static get allNodeTimings(): Map<string, Map<Graph.Node, CompleteNodeTiming>> {\n return ALL_SIMULATION_NODE_TIMINGS;\n }\n\n /**\n * We attempt to start nodes by their observed start time using the request priority as a tie breaker.\n * When simulating, just because a low priority image started 5ms before a high priority image doesn't mean\n * it would have happened like that when the network was slower.\n */\n static computeNodeStartPosition(node: Graph.Node): number {\n if (node.type === 'cpu') {\n return node.startTime;\n }\n return node.startTime + (PriorityStartTimePenalty[node.request.priority] * 1000 * 1000 || 0);\n }\n}\n\nexport {Simulator};\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"allowJs": true,
|
|
4
|
+
"checkJs": true,
|
|
5
|
+
"composite": true,
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"experimentalDecorators": true,
|
|
8
|
+
"forceConsistentCasingInFileNames": true,
|
|
9
|
+
"inlineSources": true,
|
|
10
|
+
"lib": [
|
|
11
|
+
"esnext",
|
|
12
|
+
"dom",
|
|
13
|
+
"dom.iterable"
|
|
14
|
+
],
|
|
15
|
+
"module": "esnext",
|
|
16
|
+
"noEmitOnError": true,
|
|
17
|
+
"noFallthroughCasesInSwitch": true,
|
|
18
|
+
"noImplicitOverride": true,
|
|
19
|
+
"noImplicitReturns": true,
|
|
20
|
+
"noUnusedLocals": false,
|
|
21
|
+
"noUnusedParameters": false,
|
|
22
|
+
"outDir": ".",
|
|
23
|
+
"rootDir": ".",
|
|
24
|
+
"skipLibCheck": true,
|
|
25
|
+
"sourceMap": true,
|
|
26
|
+
"strict": true,
|
|
27
|
+
"target": "esnext",
|
|
28
|
+
"tsBuildInfoFile": "devtools_entrypoint-bundle-tsconfig-tsconfig.json.tsbuildinfo",
|
|
29
|
+
"typeRoots": [],
|
|
30
|
+
"useUnknownInCatchVariables": false
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"simulation.prebundle.ts",
|
|
34
|
+
"../../../../../../../../front_end/legacy/legacy-defs.d.ts",
|
|
35
|
+
"../../../../../../../../front_end/global_typings/global_defs.d.ts",
|
|
36
|
+
"../../../../../../../../node_modules/@types/filesystem/index.d.ts"
|
|
37
|
+
],
|
|
38
|
+
"references": [
|
|
39
|
+
{
|
|
40
|
+
"path": "./simulation-tsconfig.json"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Copyright 2024 The Chromium Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
export * from './ConnectionPool.js';
|
|
5
|
+
export * from './Constants.js';
|
|
6
|
+
export * from './DNSCache.js';
|
|
7
|
+
export * from './SimulationTimingMap.js';
|
|
8
|
+
export * from './Simulator.js';
|
|
9
|
+
export * from './TCPConnection.js';
|
|
10
|
+
//# sourceMappingURL=simulation.prebundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simulation.prebundle.js","sourceRoot":"","sources":["simulation.prebundle.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,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\nexport * from './ConnectionPool.js';\nexport * from './Constants.js';\nexport * from './DNSCache.js';\nexport * from './SimulationTimingMap.js';\nexport * from './Simulator.js';\nexport * from './TCPConnection.js';\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Copyright 2024 The Chromium Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
export * from './ConnectionPool.js';
|
|
6
|
+
export * from './Constants.js';
|
|
7
|
+
export * from './DNSCache.js';
|
|
8
|
+
export * from './SimulationTimingMap.js';
|
|
9
|
+
export * from './Simulator.js';
|
|
10
|
+
export * from './TCPConnection.js';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"allowJs": true,
|
|
4
|
+
"checkJs": true,
|
|
5
|
+
"composite": true,
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"experimentalDecorators": true,
|
|
8
|
+
"forceConsistentCasingInFileNames": true,
|
|
9
|
+
"inlineSources": true,
|
|
10
|
+
"lib": [
|
|
11
|
+
"esnext",
|
|
12
|
+
"dom",
|
|
13
|
+
"dom.iterable"
|
|
14
|
+
],
|
|
15
|
+
"module": "esnext",
|
|
16
|
+
"noEmitOnError": true,
|
|
17
|
+
"noFallthroughCasesInSwitch": true,
|
|
18
|
+
"noImplicitOverride": true,
|
|
19
|
+
"noImplicitReturns": true,
|
|
20
|
+
"noUnusedLocals": false,
|
|
21
|
+
"noUnusedParameters": false,
|
|
22
|
+
"outDir": ".",
|
|
23
|
+
"rootDir": ".",
|
|
24
|
+
"skipLibCheck": true,
|
|
25
|
+
"sourceMap": true,
|
|
26
|
+
"strict": true,
|
|
27
|
+
"target": "esnext",
|
|
28
|
+
"tsBuildInfoFile": "devtools_entrypoint-bundle-tsconfig-tsconfig.json.tsbuildinfo",
|
|
29
|
+
"typeRoots": [],
|
|
30
|
+
"useUnknownInCatchVariables": false
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"types.prebundle.ts",
|
|
34
|
+
"../../../../../../../../front_end/legacy/legacy-defs.d.ts",
|
|
35
|
+
"../../../../../../../../front_end/global_typings/global_defs.d.ts",
|
|
36
|
+
"../../../../../../../../node_modules/@types/filesystem/index.d.ts"
|
|
37
|
+
],
|
|
38
|
+
"references": [
|
|
39
|
+
{
|
|
40
|
+
"path": "./types-tsconfig.json"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Lantern.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.prebundle.js","sourceRoot":"","sources":["types.prebundle.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,cAAc,cAAc,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\nexport * from './Lantern.js';\n"]}
|
|
@@ -33,7 +33,6 @@
|
|
|
33
33
|
"../../../../../../front_end/models/trace/LanternComputationData.ts",
|
|
34
34
|
"../../../../../../front_end/models/trace/ModelImpl.ts",
|
|
35
35
|
"../../../../../../front_end/models/trace/Processor.ts",
|
|
36
|
-
"../../../../../../front_end/models/trace/TracingManager.ts",
|
|
37
36
|
"../../../../../../front_end/legacy/legacy-defs.d.ts",
|
|
38
37
|
"../../../../../../front_end/global_typings/global_defs.d.ts",
|
|
39
38
|
"../../../../../../node_modules/@types/filesystem/index.d.ts"
|
package/models/trace/trace.d.ts
CHANGED
|
@@ -6,6 +6,5 @@ import * as Lantern from './lantern/lantern.js';
|
|
|
6
6
|
import * as LanternComputationData from './LanternComputationData.js';
|
|
7
7
|
import * as TraceModel from './ModelImpl.js';
|
|
8
8
|
import * as Processor from './Processor.js';
|
|
9
|
-
import * as TracingManager from './TracingManager.js';
|
|
10
9
|
import * as Types from './types/types.js';
|
|
11
|
-
export { Extras, Handlers, Helpers, Insights, Lantern, LanternComputationData, Processor, TraceModel,
|
|
10
|
+
export { Extras, Handlers, Helpers, Insights, Lantern, LanternComputationData, Processor, TraceModel, Types, };
|
package/models/trace/trace.js
CHANGED
|
@@ -9,7 +9,6 @@ import * as Lantern from './lantern/lantern.js';
|
|
|
9
9
|
import * as LanternComputationData from './LanternComputationData.js';
|
|
10
10
|
import * as TraceModel from './ModelImpl.js';
|
|
11
11
|
import * as Processor from './Processor.js';
|
|
12
|
-
import * as TracingManager from './TracingManager.js';
|
|
13
12
|
import * as Types from './types/types.js';
|
|
14
|
-
export { Extras, Handlers, Helpers, Insights, Lantern, LanternComputationData, Processor, TraceModel,
|
|
13
|
+
export { Extras, Handlers, Helpers, Insights, Lantern, LanternComputationData, Processor, TraceModel, Types, };
|
|
15
14
|
//# sourceMappingURL=trace.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../../../../front_end/models/trace/trace.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAC;AACnD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAC;AACnD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,sBAAsB,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,UAAU,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../../../../front_end/models/trace/trace.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAC;AACnD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAC;AACnD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,sBAAsB,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,UAAU,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EACL,MAAM,EACN,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,OAAO,EACP,sBAAsB,EACtB,SAAS,EACT,UAAU,EACV,KAAK,GACN,CAAC","sourcesContent":["// Copyright 2022 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 * as Extras from './extras/extras.js';\nimport * as Handlers from './handlers/handlers.js';\nimport * as Helpers from './helpers/helpers.js';\nimport * as Insights from './insights/insights.js';\nimport * as Lantern from './lantern/lantern.js';\nimport * as LanternComputationData from './LanternComputationData.js';\nimport * as TraceModel from './ModelImpl.js';\nimport * as Processor from './Processor.js';\nimport * as Types from './types/types.js';\n\nexport {\n Extras,\n Handlers,\n Helpers,\n Insights,\n Lantern,\n LanternComputationData,\n Processor,\n TraceModel,\n Types,\n};\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as Extras from './extras/extras.js';
|
|
2
|
+
import * as Handlers from './handlers/handlers.js';
|
|
3
|
+
import * as Helpers from './helpers/helpers.js';
|
|
4
|
+
import * as Insights from './insights/insights.js';
|
|
5
|
+
import * as Lantern from './lantern/lantern.js';
|
|
6
|
+
import * as LanternComputationData from './LanternComputationData.js';
|
|
7
|
+
import * as TraceModel from './ModelImpl.js';
|
|
8
|
+
import * as Processor from './Processor.js';
|
|
9
|
+
import * as Types from './types/types.js';
|
|
10
|
+
export { Extras, Handlers, Helpers, Insights, Lantern, LanternComputationData, Processor, TraceModel, Types, };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright 2022 The Chromium Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
import * as Extras from './extras/extras.js';
|
|
5
|
+
import * as Handlers from './handlers/handlers.js';
|
|
6
|
+
import * as Helpers from './helpers/helpers.js';
|
|
7
|
+
import * as Insights from './insights/insights.js';
|
|
8
|
+
import * as Lantern from './lantern/lantern.js';
|
|
9
|
+
import * as LanternComputationData from './LanternComputationData.js';
|
|
10
|
+
import * as TraceModel from './ModelImpl.js';
|
|
11
|
+
import * as Processor from './Processor.js';
|
|
12
|
+
import * as Types from './types/types.js';
|
|
13
|
+
export { Extras, Handlers, Helpers, Insights, Lantern, LanternComputationData, Processor, TraceModel, Types, };
|
|
14
|
+
//# sourceMappingURL=trace.prebundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace.prebundle.js","sourceRoot":"","sources":["trace.prebundle.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAC;AACnD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAC;AACnD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,sBAAsB,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,UAAU,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EACL,MAAM,EACN,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,OAAO,EACP,sBAAsB,EACtB,SAAS,EACT,UAAU,EACV,KAAK,GACN,CAAC","sourcesContent":["// Copyright 2022 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 * as Extras from './extras/extras.js';\nimport * as Handlers from './handlers/handlers.js';\nimport * as Helpers from './helpers/helpers.js';\nimport * as Insights from './insights/insights.js';\nimport * as Lantern from './lantern/lantern.js';\nimport * as LanternComputationData from './LanternComputationData.js';\nimport * as TraceModel from './ModelImpl.js';\nimport * as Processor from './Processor.js';\nimport * as Types from './types/types.js';\n\nexport {\n Extras,\n Handlers,\n Helpers,\n Insights,\n Lantern,\n LanternComputationData,\n Processor,\n TraceModel,\n Types,\n};\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Copyright 2022 The Chromium Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import * as Extras from './extras/extras.js';
|
|
6
|
+
import * as Handlers from './handlers/handlers.js';
|
|
7
|
+
import * as Helpers from './helpers/helpers.js';
|
|
8
|
+
import * as Insights from './insights/insights.js';
|
|
9
|
+
import * as Lantern from './lantern/lantern.js';
|
|
10
|
+
import * as LanternComputationData from './LanternComputationData.js';
|
|
11
|
+
import * as TraceModel from './ModelImpl.js';
|
|
12
|
+
import * as Processor from './Processor.js';
|
|
13
|
+
import * as Types from './types/types.js';
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
Extras,
|
|
17
|
+
Handlers,
|
|
18
|
+
Helpers,
|
|
19
|
+
Insights,
|
|
20
|
+
Lantern,
|
|
21
|
+
LanternComputationData,
|
|
22
|
+
Processor,
|
|
23
|
+
TraceModel,
|
|
24
|
+
Types,
|
|
25
|
+
};
|
|
@@ -4,7 +4,12 @@ export declare const extensionPalette: readonly ["primary", "primary-light", "pr
|
|
|
4
4
|
export type ExtensionColorFromPalette = typeof extensionPalette[number];
|
|
5
5
|
export interface ExtensionDataPayloadBase {
|
|
6
6
|
color?: ExtensionColorFromPalette;
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* We document to users that we support only string values here, but because
|
|
9
|
+
* this is coming from user code the values could be anything, so we ensure we
|
|
10
|
+
* deal with bad data by typing this as unknown.
|
|
11
|
+
*/
|
|
12
|
+
properties?: Array<[string, unknown]>;
|
|
8
13
|
tooltipText?: string;
|
|
9
14
|
}
|
|
10
15
|
export type ExtensionDataPayload = ExtensionTrackEntryPayload | ExtensionMarkerPayload;
|
|
@@ -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;AAQ7B,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;
|
|
1
|
+
{"version":3,"file":"Extensions.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/Extensions.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAQ7B,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;AAsDX,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 {\n Args, ConsoleTimeStamp, Event, PerformanceMark, PerformanceMeasureBegin, Phase, SyntheticBased} from\n './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 interface ExtensionDataPayloadBase {\n color?: ExtensionColorFromPalette;\n /**\n * We document to users that we support only string values here, but because\n * this is coming from user code the values could be anything, so we ensure we\n * deal with bad data by typing this as unknown.\n */\n properties?: Array<[string, unknown]>;\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\n SyntheticBased<Phase.COMPLETE, PerformanceMeasureBegin|PerformanceMark|ConsoleTimeStamp> {\n args: Args&ExtensionTrackEntryPayload;\n}\n\n/**\n * Synthetic events created for extension marks.\n */\nexport interface SyntheticExtensionMarker extends SyntheticBased<Phase.COMPLETE, PerformanceMark> {\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: Record<string, SyntheticExtensionTrackEntry[]>;\n}\n"]}
|
|
@@ -129,6 +129,20 @@ export interface Modifications {
|
|
|
129
129
|
initialBreadcrumb: Breadcrumb;
|
|
130
130
|
annotations: SerializedAnnotations;
|
|
131
131
|
}
|
|
132
|
+
export interface TrackVisualConfig {
|
|
133
|
+
hidden: boolean;
|
|
134
|
+
expanded: boolean;
|
|
135
|
+
originalIndex: number;
|
|
136
|
+
visualIndex: number;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Stores the visual config if the user has modified it. Split into "main" and
|
|
140
|
+
* "network" so we can pass the relevant config into the right data provider.
|
|
141
|
+
*/
|
|
142
|
+
export interface PersistedTraceVisualConfig {
|
|
143
|
+
main: TrackVisualConfig[] | null;
|
|
144
|
+
network: TrackVisualConfig[] | null;
|
|
145
|
+
}
|
|
132
146
|
/**
|
|
133
147
|
* Trace metadata that we persist to the file. This will allow us to
|
|
134
148
|
* store specifics for the trace, e.g., which tracks should be visible
|
|
@@ -141,13 +155,14 @@ export interface MetaData {
|
|
|
141
155
|
networkThrottling?: string;
|
|
142
156
|
networkThrottlingConditions?: Omit<any, 'title'>;
|
|
143
157
|
cpuThrottling?: number;
|
|
144
|
-
hardwareConcurrency?: number;
|
|
145
158
|
dataOrigin?: DataOrigin;
|
|
146
159
|
enhancedTraceVersion?: number;
|
|
147
160
|
modifications?: Modifications;
|
|
148
161
|
cruxFieldData?: any[];
|
|
149
162
|
/** Currently only stores JS maps, not CSS. This never stores data url source maps. */
|
|
150
163
|
sourceMaps?: MetadataSourceMap[];
|
|
164
|
+
visualTrackConfig?: PersistedTraceVisualConfig;
|
|
165
|
+
hostDPR?: number;
|
|
151
166
|
}
|
|
152
167
|
interface MetadataSourceMap {
|
|
153
168
|
url: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"File.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/File.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAmB7B,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,wCAA0B,CAAA;IAC1B,0CAA4B,CAAA;AAC9B,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAED;;;;;GAKG;AACH,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,iEAA6C,CAAA;IAC7C,yDAAqC,CAAA;IACrC,2CAAuB,CAAA;AACzB,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B;AAED,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,+BAAe,CAAA;IACf,qCAAqB,CAAA;IACrB,kCAAkB,CAAA;IAClB,2CAA2B,CAAA;AAC7B,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AAuED,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;AAmFD,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;IA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K,YAAY,CAAC,eAAe;YAC/B,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,KAAK,YAAY,CAAC,qBAAqB,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.\n\nimport type * as SDK from '../../../core/sdk/sdk.js';\nimport type * as Protocol from '../../../generated/protocol.js';\nimport type * as CrUXManager from '../../../models/crux-manager/crux-manager.js';\n\nimport type {TraceWindowMicro} from './Timing.js';\nimport type {Event, LegacyTimelineFrame, ProcessID, SampleIndex, ThreadID} from './TraceEvents.js';\n\nexport interface TraceFile {\n traceEvents: readonly Event[];\n metadata: MetaData;\n}\n\nexport interface Breadcrumb {\n window: TraceWindowMicro;\n child: Breadcrumb|null;\n}\n\nexport 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 enum EntriesLinkState {\n CREATION_NOT_STARTED = 'creation_not_started',\n PENDING_TO_EVENT = 'pending_to_event',\n CONNECTED = 'connected',\n}\n\nexport 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: TraceWindowMicro;\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: TraceWindowMicro;\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 interface RawEventKeyValues {\n type: EventKeyType.RAW_EVENT;\n rawIndex: number;\n}\n\nexport interface SyntheticEventKeyValues {\n type: EventKeyType.SYNTHETIC_EVENT;\n rawIndex: number;\n}\n\nexport interface ProfileCallKeyValues {\n type: EventKeyType.PROFILE_CALL;\n processID: ProcessID;\n threadID: ThreadID;\n sampleIndex: SampleIndex;\n protocol: Protocol.integer;\n}\n\nexport interface 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 emulatedDeviceTitle?: string;\n // Only set if network throttling is active.\n networkThrottling?: string;\n // Only set if network throttling is active.\n networkThrottlingConditions?: Omit<SDK.NetworkManager.Conditions, 'title'>;\n // Only set if CPU throttling is active.\n cpuThrottling?: number;\n hardwareConcurrency?: number;\n dataOrigin?: DataOrigin;\n enhancedTraceVersion?: number;\n modifications?: Modifications;\n cruxFieldData?: CrUXManager.PageResult[];\n /** Currently only stores JS maps, not CSS. This never stores data url source maps. */\n sourceMaps?: MetadataSourceMap[];\n}\n\ninterface MetadataSourceMap {\n url: string;\n /** If not defined, then this was a data url. */\n sourceMapUrl?: string;\n sourceMap: SDK.SourceMap.SourceMapV3;\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"]}
|
|
1
|
+
{"version":3,"file":"File.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/File.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAmB7B,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,wCAA0B,CAAA;IAC1B,0CAA4B,CAAA;AAC9B,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAED;;;;;GAKG;AACH,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,iEAA6C,CAAA;IAC7C,yDAAqC,CAAA;IACrC,2CAAuB,CAAA;AACzB,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B;AAED,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,+BAAe,CAAA;IACf,qCAAqB,CAAA;IACrB,kCAAkB,CAAA;IAClB,2CAA2B,CAAA;AAC7B,C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AO;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.\n\nimport type * as SDK from '../../../core/sdk/sdk.js';\nimport type * as Protocol from '../../../generated/protocol.js';\nimport type * as CrUXManager from '../../../models/crux-manager/crux-manager.js';\n\nimport type {TraceWindowMicro} from './Timing.js';\nimport type {Event, LegacyTimelineFrame, ProcessID, SampleIndex, ThreadID} from './TraceEvents.js';\n\nexport interface TraceFile {\n traceEvents: readonly Event[];\n metadata: MetaData;\n}\n\nexport interface Breadcrumb {\n window: TraceWindowMicro;\n child: Breadcrumb|null;\n}\n\nexport 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 enum EntriesLinkState {\n CREATION_NOT_STARTED = 'creation_not_started',\n PENDING_TO_EVENT = 'pending_to_event',\n CONNECTED = 'connected',\n}\n\nexport 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: TraceWindowMicro;\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: TraceWindowMicro;\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 interface RawEventKeyValues {\n type: EventKeyType.RAW_EVENT;\n rawIndex: number;\n}\n\nexport interface SyntheticEventKeyValues {\n type: EventKeyType.SYNTHETIC_EVENT;\n rawIndex: number;\n}\n\nexport interface ProfileCallKeyValues {\n type: EventKeyType.PROFILE_CALL;\n processID: ProcessID;\n threadID: ThreadID;\n sampleIndex: SampleIndex;\n protocol: Protocol.integer;\n}\n\nexport interface 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// IMPORTANT: this is the same as PerfUI.FlameChart.PersistedGroupConfig\n// However, the PerfUI code should not depend on the model/trace, and similarly\n// this model cannot depend on that code, so we duplicate it.\nexport interface TrackVisualConfig {\n hidden: boolean;\n expanded: boolean;\n originalIndex: number;\n visualIndex: number;\n}\n\n/**\n * Stores the visual config if the user has modified it. Split into \"main\" and\n * \"network\" so we can pass the relevant config into the right data provider.\n */\nexport interface PersistedTraceVisualConfig {\n main: TrackVisualConfig[]|null;\n network: TrackVisualConfig[]|null;\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 emulatedDeviceTitle?: string;\n // Only set if network throttling is active.\n networkThrottling?: string;\n // Only set if network throttling is active.\n networkThrottlingConditions?: Omit<SDK.NetworkManager.Conditions, 'title'>;\n // Only set if CPU throttling is active.\n cpuThrottling?: number;\n dataOrigin?: DataOrigin;\n enhancedTraceVersion?: number;\n modifications?: Modifications;\n cruxFieldData?: CrUXManager.PageResult[];\n /** Currently only stores JS maps, not CSS. This never stores data url source maps. */\n sourceMaps?: MetadataSourceMap[];\n visualTrackConfig?: PersistedTraceVisualConfig;\n hostDPR?: number;\n}\n\ninterface MetadataSourceMap {\n url: string;\n /** If not defined, then this was a data url. */\n sourceMapUrl?: string;\n sourceMap: SDK.SourceMap.SourceMapV3;\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Timing.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/Timing.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAG7B,gEAAgE;AAChE,MAAM,UAAU,KAAK,CAAC,KAAa;IACjC,OAAO,KAAc,CAAC;AACxB,CAAC;AAGD,gEAAgE;AAChE,MAAM,UAAU,KAAK,CAAC,KAAa;IACjC,OAAO,KAAc,CAAC;AACxB,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,OAAO,CAAC,KAAa;IACnC,OAAO,KAAgB,CAAC;AAC1B,CAAC","sourcesContent":["// Copyright 2022 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 Micro = number&{_tag: 'MicroSeconds'};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function Micro(value: number): Micro {\n return value as Micro;\n}\n\nexport type Milli = number&{_tag: 'MilliSeconds'};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function Milli(value: number): Milli {\n return value as Milli;\n}\nexport type Seconds = number&{_tag: 'Seconds'};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function Seconds(value: number): Seconds {\n return value as Seconds;\n}\n\nexport interface TraceWindow<TimeFormat extends Micro|Milli> {\n min: TimeFormat;\n max: TimeFormat;\n range: TimeFormat;\n}\n\nexport type TraceWindowMicro = TraceWindow<Micro>;\nexport type TraceWindowMilli = TraceWindow<Milli>;\n"]}
|
|
1
|
+
{"version":3,"file":"Timing.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/Timing.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAG7B,gEAAgE;AAChE,MAAM,UAAU,KAAK,CAAC,KAAa;IACjC,OAAO,KAAc,CAAC;AACxB,CAAC;AAGD,gEAAgE;AAChE,MAAM,UAAU,KAAK,CAAC,KAAa;IACjC,OAAO,KAAc,CAAC;AACxB,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,OAAO,CAAC,KAAa;IACnC,OAAO,KAAgB,CAAC;AAC1B,CAAC","sourcesContent":["// Copyright 2022 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 Micro = number&{_tag: 'MicroSeconds'};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function Micro(value: number): Micro {\n return value as Micro;\n}\n\nexport type Milli = number&{_tag: 'MilliSeconds'};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function Milli(value: number): Milli {\n return value as Milli;\n}\nexport type Seconds = number&{_tag: 'Seconds'};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function Seconds(value: number): Seconds {\n return value as Seconds;\n}\n\nexport interface TraceWindow<TimeFormat extends Micro|Milli> {\n min: TimeFormat;\n max: TimeFormat;\n range: TimeFormat;\n}\n\n// See front_end/models/trace/helpers/Timing.ts for helpful utility functions like traceWindowFromMicroSeconds\nexport type TraceWindowMicro = TraceWindow<Micro>;\nexport type TraceWindowMilli = TraceWindow<Milli>;\n"]}
|