haikuwebkit/LayoutTests/inspector/memory/tracking-expected.txt

16 lines
570 B
Plaintext
Raw Permalink Normal View History

Web Inspector: High Level Memory Overview Instrument https://bugs.webkit.org/show_bug.cgi?id=153516 <rdar://problem/24356378> Reviewed by Brian Burg. Source/JavaScriptCore: * CMakeLists.txt: * Configurations/FeatureDefines.xcconfig: * DerivedSources.make: * inspector/protocol/Memory.json: Added. * inspector/scripts/codegen/generator.py: New Memory domain guarded by ENABLE(RESOURCE_USAGE). This feature flag was already used in WebCore. Source/WebCore: Add a new agent that gathers data from the ResourceUsageThread and sends to the frontend. Test: inspector/memory/tracking.html * CMakeLists.txt: * Configurations/FeatureDefines.xcconfig: * WebCore.xcodeproj/project.pbxproj: New files. * inspector/InspectorController.cpp: (WebCore::InspectorController::InspectorController): Add the new agent. * inspector/InspectorMemoryAgent.h: Added. * inspector/InspectorMemoryAgent.cpp: Added. (WebCore::InspectorMemoryAgent::InspectorMemoryAgent): (WebCore::InspectorMemoryAgent::didCreateFrontendAndBackend): (WebCore::InspectorMemoryAgent::willDestroyFrontendAndBackend): (WebCore::InspectorMemoryAgent::startTracking): (WebCore::InspectorMemoryAgent::stopTracking): (WebCore::InspectorMemoryAgent::collectSample): Implement the agent by adding / removing it as a ResourceUsage observer. When receiving the data forward it to the frontend. Source/WebInspectorUI: Use the new "Memory" domain to track page memory size over time. This allows the timeline to help visualize total process memory broken down into a few different categories. The timeline graph allows seeing the total size over time, and you can drill in to a specific section and get a better breakdown and comparison of the different categories of memory that we currently track. * Localizations/en.lproj/localizedStrings.js: New UI strings. * UserInterface/Main.html: New files. * UserInterface/Base/Main.js: (WebInspector.loaded): * UserInterface/Protocol/MemoryObserver.js: (WebInspector.MemoryObserver.prototype.trackingStart): (WebInspector.MemoryObserver.prototype.trackingUpdate): (WebInspector.MemoryObserver.prototype.trackingComplete): Add a memory observer. * UserInterface/Controllers/TimelineManager.js: (WebInspector.TimelineManager.defaultInstruments): (WebInspector.TimelineManager.prototype.memoryTrackingStart): (WebInspector.TimelineManager.prototype.memoryTrackingUpdate): (WebInspector.TimelineManager.prototype.memoryTrackingComplete): Create Memory timeline records from Memory tracking updates. * UserInterface/Models/MemoryCategory.js: (WebInspector.MemoryCategory): Consolidate some of the raw data of categories we get from the backend into a set of 4 user-facing categories. * UserInterface/Models/MemoryTimelineRecord.js: Added. (WebInspector.MemoryTimelineRecord): (WebInspector.MemoryTimelineRecord.memoryCategoriesFromProtocol): (WebInspector.MemoryTimelineRecord.prototype.get timestamp): (WebInspector.MemoryTimelineRecord.prototype.get categories): (WebInspector.MemoryTimelineRecord.prototype.get totalSize): (WebInspector.MemoryTimelineRecord.prototype.get startTime): (WebInspector.MemoryTimelineRecord.prototype.get endTime): Memory timeline record for the event data. * UserInterface/Models/MemoryInstrument.js: (WebInspector.MemoryInstrument): (WebInspector.MemoryInstrument.supported): (WebInspector.MemoryInstrument.prototype.get timelineRecordType): (WebInspector.MemoryInstrument.prototype.startInstrumentation): (WebInspector.MemoryInstrument.prototype.stopInstrumentation): Instrument to start / stop memory tracking. * UserInterface/Models/TimelineRecord.js: Add a new "Memory" Timeline type. * UserInterface/Views/ContentView.js: (WebInspector.ContentView.createFromRepresentedObject): * UserInterface/Models/TimelineRecording.js: (WebInspector.TimelineRecording): Add the new "Memory" Timeline. (WebInspector.TimelineRecording.prototype.addRecord): Memory timeline records do not show in the SourceCode Timelines Overview. * UserInterface/Views/CircleChart.css: (.circle-chart): (.circle-chart > svg > path.background): (.circle-chart > .center): * UserInterface/Views/CircleChart.js: Added. (WebInspector.CircleChart): (WebInspector.CircleChart.prototype.get element): (WebInspector.CircleChart.prototype.get points): (WebInspector.CircleChart.prototype.get size): (WebInspector.CircleChart.prototype.get centerElement): (WebInspector.CircleChart.prototype.get segments): (WebInspector.CircleChart.prototype.set segments): (WebInspector.CircleChart.prototype.get values): (WebInspector.CircleChart.prototype.set values): (WebInspector.CircleChart.prototype.clear): (WebInspector.CircleChart.prototype.needsLayout): (WebInspector.CircleChart.prototype.updateLayout): (WebInspector.CircleChart.prototype._needsLayout): (WebInspector.CircleChart.prototype._createCompleteCirclePathData): (WebInspector.CircleChart.prototype._createSegmentPathData): (WebInspector.CircleChart.prototype._updateLayout): Standalone circle "donut" chart, copied mostly from Rendering Frames Timeline. Initialize the chart's segments, then feed it a set of ([v1, v2, ...]) values corresponding to each of the segments. * UserInterface/Views/LineChart.js: Added. (WebInspector.LineChart): (WebInspector.LineChart.prototype.get element): (WebInspector.LineChart.prototype.get points): (WebInspector.LineChart.prototype.get size): (WebInspector.LineChart.prototype.set size): (WebInspector.LineChart.prototype.addPoint): (WebInspector.LineChart.prototype.clear): (WebInspector.LineChart.prototype.needsLayout): (WebInspector.LineChart.prototype.updateLayout): (WebInspector.LineChart.prototype._needsLayout): (WebInspector.LineChart.prototype._updateLayout): Standalone line chart. Uses a single SVG path, given a set of (x, y) points. * UserInterface/Views/StackedLineChart.js: Added. (WebInspector.StackedLineChart): (WebInspector.StackedLineChart.prototype.get element): (WebInspector.StackedLineChart.prototype.get points): (WebInspector.StackedLineChart.prototype.get size): (WebInspector.StackedLineChart.prototype.set size): (WebInspector.StackedLineChart.prototype.initializeSections): (WebInspector.StackedLineChart.prototype.addPointSet): (WebInspector.StackedLineChart.prototype.clear): (WebInspector.StackedLineChart.prototype.needsLayout): (WebInspector.StackedLineChart.prototype.updateLayout): (WebInspector.StackedLineChart.prototype._needsLayout): (WebInspector.StackedLineChart.prototype._updateLayout): Standalone stacked line chart. Initialize the chart's sections, then feed it a set of (x, [y1, y2 ...]) points where the y values correspond to each of the sections. * UserInterface/Views/TimelineOverview.js: (WebInspector.TimelineOverview.prototype.get scrollContainerWidth): Add a way to get this value without forcing layout all the time. * UserInterface/Views/TimelineTabContentView.js: (WebInspector.TimelineTabContentView.displayNameForTimeline): (WebInspector.TimelineTabContentView.iconClassNameForTimeline): (WebInspector.TimelineTabContentView.genericClassNameForTimeline): (WebInspector.TimelineTabContentView.iconClassNameForRecord): (WebInspector.TimelineTabContentView.displayNameForRecord): Add placeholders for the new Memory Timeline Type. * UserInterface/Views/MemoryCategoryView.css: (.memory-category-view): (.memory-category-view > .details): (.memory-category-view > .details > .name): (.memory-category-view > .graph): * UserInterface/Views/MemoryCategoryView.js: Added. (WebInspector.MemoryCategoryView): (WebInspector.MemoryCategoryView.prototype.get element): (WebInspector.MemoryCategoryView.prototype.get category): (WebInspector.MemoryCategoryView.prototype.clear): (WebInspector.MemoryCategoryView.prototype.layoutWithDataPoints): (WebInspector.MemoryCategoryView.prototype._updateDetails): * UserInterface/Views/MemoryTimelineOverviewGraph.css: (body .timeline-overview > .graphs-container > .timeline-overview-graph.memory): (.timeline-overview-graph.memory): (.timeline-overview-graph.memory > .legend): (.timeline-overview-graph.memory > .stacked-line-chart > svg > path.javascript): (.timeline-overview-graph.memory > .stacked-line-chart > svg > path.images): (.timeline-overview-graph.memory > .stacked-line-chart > svg > path.layers): (.timeline-overview-graph.memory > .stacked-line-chart > svg > path.page): * UserInterface/Views/MemoryTimelineOverviewGraph.js: Added. (WebInspector.MemoryTimelineOverviewGraph): (WebInspector.MemoryTimelineOverviewGraph.prototype.get height): (WebInspector.MemoryTimelineOverviewGraph.prototype.reset): (WebInspector.MemoryTimelineOverviewGraph.prototype.layout.timeToX): (WebInspector.MemoryTimelineOverviewGraph.prototype.layout.sizeToY): (WebInspector.MemoryTimelineOverviewGraph.prototype.layout.sizesToYs): (WebInspector.MemoryTimelineOverviewGraph.prototype.layout.ysForRecord): (WebInspector.MemoryTimelineOverviewGraph.prototype.layout): (WebInspector.MemoryTimelineOverviewGraph.prototype._updateLegend): (WebInspector.MemoryTimelineOverviewGraph.prototype._visibleRecords): (WebInspector.MemoryTimelineOverviewGraph.prototype._memoryTimelineRecordAdded): * UserInterface/Views/MemoryTimelineView.css: Added. (.timeline-view.memory): (.timeline-view.memory > .content): (.timeline-view.memory > .content > .overview): (.timeline-view.memory > .content .title): (.timeline-view.memory > .content .subtitle): (.timeline-view.memory > .content > .details > .timeline-ruler): (.timeline-view.memory > .content > .details > .subtitle): (.timeline-view.memory > .content > .overview > .chart): (.timeline-view.memory > .content > .overview > .chart > .subtitle): (.timeline-view.memory > .content > .overview > .chart > .container): (.timeline-view.memory > .content > .overview > .divider): (.timeline-view.memory > .content > .overview .max-percentage): (.timeline-view.memory .legend): (.timeline-view.memory .legend > .row): (.timeline-view.memory .legend > .row > .swatch): (.timeline-view.memory .legend > .row > p): (.timeline-view.memory .legend > .row > .label): (.timeline-view.memory .legend > .row > .size): (.timeline-view.memory .legend > .row > .swatch.javascript): (.timeline-view.memory .legend > .row > .swatch.images): (.timeline-view.memory .legend > .row > .swatch.layers): (.timeline-view.memory .legend > .row > .swatch.page): (.memory-category-view.javascript .line-chart > svg > path): (.memory-category-view.images .line-chart > svg > path): (.memory-category-view.layers .line-chart > svg > path): (.memory-category-view.page .line-chart > svg > path): (.timeline-view.memory .legend > .row > .swatch.current): (.timeline-view.memory .circle-chart > svg > path.current): (.timeline-view.memory .circle-chart > svg > path.remainder): * UserInterface/Views/MemoryTimelineView.js: Added. (WebInspector.MemoryTimelineView): (WebInspector.MemoryTimelineView.displayNameForCategory): (WebInspector.MemoryTimelineView.prototype.get navigationSidebarTreeOutlineLabel): (WebInspector.MemoryTimelineView.prototype.shown): (WebInspector.MemoryTimelineView.prototype.hidden): (WebInspector.MemoryTimelineView.prototype.closed): (WebInspector.MemoryTimelineView.prototype.reset): (WebInspector.MemoryTimelineView.prototype.treeElementPathComponentSelected): (WebInspector.MemoryTimelineView.prototype.layout.timeToX): (WebInspector.MemoryTimelineView.prototype.layout.sizeToY): (WebInspector.MemoryTimelineView.prototype.layout.layoutCategoryView): (WebInspector.MemoryTimelineView.prototype.layout): (WebInspector.MemoryTimelineView.prototype._clearUsageLegend): (WebInspector.MemoryTimelineView.prototype._updateUsageLegend): (WebInspector.MemoryTimelineView.prototype._clearMaxComparisonLegend): (WebInspector.MemoryTimelineView.prototype._updateMaxComparisonLegend): (WebInspector.MemoryTimelineView.prototype._visibleRecords): (WebInspector.MemoryTimelineView.prototype._initializeCategoryViews.appendLegendRow): (WebInspector.MemoryTimelineView.prototype._initializeCategoryViews): (WebInspector.MemoryTimelineView.prototype._memoryTimelineRecordAdded): * UserInterface/Views/Variables.css: (:root): Memory timeline view styles. Source/WebKit/mac: * Configurations/FeatureDefines.xcconfig: Source/WebKit2: * Configurations/FeatureDefines.xcconfig: LayoutTests: * inspector/memory/tracking-expected.txt: Added. * inspector/memory/tracking.html: Added. Basic test for the new domain tracking commands and events. * platform/efl/TestExpectations: * platform/gtk/TestExpectations: * platform/win/TestExpectations: Skip the directory on ports that have not implemented ENABLE(RESOURCE_USAGE). Canonical link: https://commits.webkit.org/171861@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195999 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-02-02 01:52:16 +00:00
Tests that Memory.startTracking and Memory.stopTracking trigger trackingStart, trackingUpdate, and trackingComplete events with expected data.
Web Inspector: CPU Usage Timeline https://bugs.webkit.org/show_bug.cgi?id=193730 <rdar://problem/46797201> Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-01-24 Reviewed by Devin Rousso. Source/JavaScriptCore: * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources.make: New files. * inspector/protocol/CPUProfiler.json: Added. New domain that follows the pattern of Memory/ScriptProfiler. * inspector/protocol/Timeline.json: New enum to auto-start a CPU instrument in the backend. Source/WebCore: Test: inspector/cpu-profiler/tracking.html * Sources.txt: * UnifiedSources-input.xcfilelist: * WebCore.xcodeproj/project.pbxproj: New files. * inspector/InspectorController.cpp: (WebCore::InspectorController::createLazyAgents): * inspector/InstrumentingAgents.cpp: (WebCore::InstrumentingAgents::reset): * inspector/InstrumentingAgents.h: (WebCore::InstrumentingAgents::inspectorCPUProfilerAgent const): (WebCore::InstrumentingAgents::setInspectorCPUProfilerAgent): Create and track the CPUProfilerAgent. * inspector/agents/InspectorTimelineAgent.cpp: (WebCore::InspectorTimelineAgent::toggleInstruments): (WebCore::InspectorTimelineAgent::toggleCPUInstrument): Handle backend auto-start of the CPU instrument / timeline. * inspector/agents/InspectorCPUProfilerAgent.h: * inspector/agents/InspectorCPUProfilerAgent.cpp: Added. (WebCore::InspectorCPUProfilerAgent::InspectorCPUProfilerAgent): (WebCore::InspectorCPUProfilerAgent::didCreateFrontendAndBackend): (WebCore::InspectorCPUProfilerAgent::willDestroyFrontendAndBackend): (WebCore::InspectorCPUProfilerAgent::startTracking): (WebCore::InspectorCPUProfilerAgent::stopTracking): (WebCore::InspectorCPUProfilerAgent::collectSample): CPUProfilerAgent uses the ResourceUsageThread to get CPU data. * inspector/agents/InspectorTimelineAgent.h: * inspector/agents/InspectorMemoryAgent.cpp: (WebCore::InspectorMemoryAgent::startTracking): (WebCore::InspectorMemoryAgent::collectSample): Update the MemoryAgent to collect only Memory data and use a more accurate sample timestamp. * page/ResourceUsageData.h: * page/ResourceUsageThread.cpp: (WebCore::ResourceUsageThread::addObserver): (WebCore::ResourceUsageThread::removeObserver): (WebCore::ResourceUsageThread::notifyObservers): (WebCore::ResourceUsageThread::recomputeCollectionMode): (WebCore::ResourceUsageThread::threadBody): * page/ResourceUsageThread.h: * page/cocoa/ResourceUsageOverlayCocoa.mm: (WebCore::ResourceUsageOverlay::platformInitialize): * page/cocoa/ResourceUsageThreadCocoa.mm: (WebCore::ResourceUsageThread::platformCollectCPUData): (WebCore::ResourceUsageThread::platformCollectMemoryData): (WebCore::ResourceUsageThread::platformThreadBody): Deleted. * page/linux/ResourceUsageOverlayLinux.cpp: (WebCore::ResourceUsageOverlay::platformInitialize): * page/linux/ResourceUsageThreadLinux.cpp: (WebCore::ResourceUsageThread::platformCollectCPUData): (WebCore::ResourceUsageThread::platformCollectMemoryData): (WebCore::ResourceUsageThread::platformThreadBody): Give each observer their own collection mode. The ResourceUsageThread will then collect data that is the union of all of the active observers. This allows collecting CPU and Memory data separately, reducing the cost of each when gathered individually. Source/WebInspectorUI: CPU Usage is gathered in the backend twice a second, the frequency of the ResourceUsageThread in WebCore. The frontend displays cpu usage in a few ways in the Timeline. We use a column chart in the timeline overview to display the frequency and relative distance of samples. This helps show if the samples were close together or far apart, which indicates how meaningful they will be at a particular scale. We use a line chart in the timeline detail view which will be easier to see the changes over a particular time range selection. * Localizations/en.lproj/localizedStrings.js: New strings. * UserInterface/Main.html: * UserInterface/Base/Main.js: (WI.loaded): * UserInterface/Test.html: * UserInterface/Test/Test.js: (WI.loaded): * UserInterface/Protocol/CPUProfilerObserver.js: (WI.CPUProfilerObserver.prototype.trackingStart): (WI.CPUProfilerObserver.prototype.trackingUpdate): (WI.CPUProfilerObserver.prototype.trackingComplete): (WI.CPUProfilerObserver): New files and default registration. * UserInterface/Protocol/Target.js: (WI.Target.prototype.get CPUProfilerAgent): New Agent. * UserInterface/Controllers/TimelineManager.js: (WI.TimelineManager.availableTimelineTypes): (WI.TimelineManager.prototype.cpuProfilerTrackingStarted): (WI.TimelineManager.prototype.cpuProfilerTrackingUpdated): (WI.TimelineManager.prototype.cpuProfilerTrackingCompleted): (WI.TimelineManager.prototype._updateAutoCaptureInstruments): (WI.TimelineManager.prototype.memoryTrackingStart): Renamed. (WI.TimelineManager.prototype.memoryTrackingUpdate): Renamed. (WI.TimelineManager.prototype.memoryTrackingComplete): Renamed. * UserInterface/Models/CPUInstrument.js: (WI.CPUInstrument): (WI.CPUInstrument.supported): (WI.CPUInstrument.prototype.get timelineRecordType): (WI.CPUInstrument.prototype.startInstrumentation): (WI.CPUInstrument.prototype.stopInstrumentation): * UserInterface/Models/CPUTimelineRecord.js: (WI.CPUTimelineRecord): (WI.CPUTimelineRecord.prototype.get timestamp): (WI.CPUTimelineRecord.prototype.get usage): * UserInterface/Models/Instrument.js: (WI.Instrument.createForTimelineType): * UserInterface/Models/TimelineRecord.js: * UserInterface/Models/TimelineRecording.js: (WI.TimelineRecording.prototype.addRecord): Expose a new CPU instrument and timeline. * UserInterface/Views/ColumnChart.js: Added. (WI.ColumnChart): (WI.ColumnChart.prototype.get element): (WI.ColumnChart.prototype.get bars): (WI.ColumnChart.prototype.get size): (WI.ColumnChart.prototype.set size): (WI.ColumnChart.prototype.addBar): (WI.ColumnChart.prototype.clear): (WI.ColumnChart.prototype.needsLayout): (WI.ColumnChart.prototype.updateLayout): View that will draw vertical bars with independent widths. This is meant to be used similiar to WI.LineChart. * UserInterface/Images/CPUInstrument.svg: Added. * UserInterface/Views/Variables.css: (:root): CPU timeline colors and icon. * UserInterface/Views/CPUTimelineOverviewGraph.css: (body .sidebar > .panel.navigation.timeline > .timelines-content li.item.cpu,): (.timeline-overview-graph.cpu): (.timeline-overview-graph.cpu > .legend): (body[dir=ltr] .timeline-overview-graph.cpu > .legend): (body[dir=rtl] .timeline-overview-graph.cpu > .legend): (.timeline-overview-graph:nth-child(even) > .legend): (body[dir=rtl] .timeline-overview-graph.cpu > .bar-chart): (.timeline-overview-graph.cpu > .bar-chart > svg > g > rect): * UserInterface/Views/CPUTimelineOverviewGraph.js: Added. (WI.CPUTimelineOverviewGraph): (WI.CPUTimelineOverviewGraph.prototype.get height): (WI.CPUTimelineOverviewGraph.prototype.reset): (WI.CPUTimelineOverviewGraph.prototype.layout.xScale): (WI.CPUTimelineOverviewGraph.prototype.layout.yScale): (WI.CPUTimelineOverviewGraph.prototype.layout.yScaleForRecord): (WI.CPUTimelineOverviewGraph.prototype.layout): (WI.CPUTimelineOverviewGraph.prototype._updateLegend): (WI.CPUTimelineOverviewGraph.prototype._cpuTimelineRecordAdded): * UserInterface/Views/CPUTimelineView.css: (.timeline-view.cpu): (.timeline-view.cpu > .content): (.timeline-view.cpu > .content .subtitle): (.timeline-view.cpu > .content > .details): (.timeline-view.cpu > .content > .details > .timeline-ruler): (body[dir=ltr] .timeline-view.cpu > .content > .details > .timeline-ruler): (body[dir=rtl] .timeline-view.cpu > .content > .details > .timeline-ruler): (.timeline-view.cpu > .content > .details > .subtitle): (.cpu-usage-view .line-chart > svg > path): (.timeline-view.cpu .legend > .row > .swatch.current): * UserInterface/Views/CPUTimelineView.js: Added. (WI.CPUTimelineView): (WI.CPUTimelineView.prototype.shown): (WI.CPUTimelineView.prototype.hidden): (WI.CPUTimelineView.prototype.closed): (WI.CPUTimelineView.prototype.reset): (WI.CPUTimelineView.prototype.get scrollableElements): (WI.CPUTimelineView.prototype.get showsFilterBar): (WI.CPUTimelineView.prototype.layout.layoutView): (WI.CPUTimelineView.prototype.layout.xScale): (WI.CPUTimelineView.prototype.layout.yScale): (WI.CPUTimelineView.prototype.layout): (WI.CPUTimelineView.prototype._cpuTimelineRecordAdded): * UserInterface/Views/CPUUsageView.css: (.cpu-usage-view): (.cpu-usage-view > .details): (body[dir=ltr] .cpu-usage-view > .details): (body[dir=rtl] .cpu-usage-view > .details): (.cpu-usage-view > .graph): (body[dir=rtl] .cpu-usage-view > .graph): * UserInterface/Views/CPUUsageView.js: (WI.CPUUsageView): (WI.CPUUsageView.prototype.get element): (WI.CPUUsageView.prototype.clear): (WI.CPUUsageView.prototype.layoutWithDataPoints): (WI.CPUUsageView.prototype._updateDetails): * UserInterface/Views/ContentView.js: (WI.ContentView.createFromRepresentedObject): * UserInterface/Views/TimelineIcons.css: (.cpu-icon .icon): * UserInterface/Views/TimelineOverviewGraph.js: (WI.TimelineOverviewGraph.createForTimeline): * UserInterface/Views/TimelineTabContentView.js: (WI.TimelineTabContentView.displayNameForTimelineType): (WI.TimelineTabContentView.iconClassNameForTimelineType): (WI.TimelineTabContentView.genericClassNameForTimelineType): (WI.TimelineTabContentView.iconClassNameForRecord): (WI.TimelineTabContentView.displayNameForRecord): Timeline views for CPU usage. * UserInterface/Views/MemoryCategoryView.js: (WI.MemoryCategoryView): * UserInterface/Views/MemoryTimelineView.js: (WI.MemoryTimelineView.createChartContainer): (WI.MemoryTimelineView): (WI.MemoryTimelineView.prototype._clearMaxComparisonLegend): Minor updates to style and comments. LayoutTests: * inspector/cpu-profiler/tracking-expected.txt: Added. * inspector/cpu-profiler/tracking.html: Added. Test the CPUProfiler domain emits events. * inspector/heap/tracking-expected.txt: * inspector/heap/tracking.html: * inspector/memory/tracking-expected.txt: * inspector/memory/tracking.html: * inspector/script-profiler/tracking-expected.txt: * inspector/script-profiler/tracking.html: Update test naming. * platform/win/TestExpectations: Skip on platforms without RESOURCE_USAGE. Canonical link: https://commits.webkit.org/208301@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240457 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-01-25 01:06:17 +00:00
== Running test suite: Memory.Tracking
-- Running test case: Memory.Tracking.StartAndStopTrackingWithEvent
Web Inspector: High Level Memory Overview Instrument https://bugs.webkit.org/show_bug.cgi?id=153516 <rdar://problem/24356378> Reviewed by Brian Burg. Source/JavaScriptCore: * CMakeLists.txt: * Configurations/FeatureDefines.xcconfig: * DerivedSources.make: * inspector/protocol/Memory.json: Added. * inspector/scripts/codegen/generator.py: New Memory domain guarded by ENABLE(RESOURCE_USAGE). This feature flag was already used in WebCore. Source/WebCore: Add a new agent that gathers data from the ResourceUsageThread and sends to the frontend. Test: inspector/memory/tracking.html * CMakeLists.txt: * Configurations/FeatureDefines.xcconfig: * WebCore.xcodeproj/project.pbxproj: New files. * inspector/InspectorController.cpp: (WebCore::InspectorController::InspectorController): Add the new agent. * inspector/InspectorMemoryAgent.h: Added. * inspector/InspectorMemoryAgent.cpp: Added. (WebCore::InspectorMemoryAgent::InspectorMemoryAgent): (WebCore::InspectorMemoryAgent::didCreateFrontendAndBackend): (WebCore::InspectorMemoryAgent::willDestroyFrontendAndBackend): (WebCore::InspectorMemoryAgent::startTracking): (WebCore::InspectorMemoryAgent::stopTracking): (WebCore::InspectorMemoryAgent::collectSample): Implement the agent by adding / removing it as a ResourceUsage observer. When receiving the data forward it to the frontend. Source/WebInspectorUI: Use the new "Memory" domain to track page memory size over time. This allows the timeline to help visualize total process memory broken down into a few different categories. The timeline graph allows seeing the total size over time, and you can drill in to a specific section and get a better breakdown and comparison of the different categories of memory that we currently track. * Localizations/en.lproj/localizedStrings.js: New UI strings. * UserInterface/Main.html: New files. * UserInterface/Base/Main.js: (WebInspector.loaded): * UserInterface/Protocol/MemoryObserver.js: (WebInspector.MemoryObserver.prototype.trackingStart): (WebInspector.MemoryObserver.prototype.trackingUpdate): (WebInspector.MemoryObserver.prototype.trackingComplete): Add a memory observer. * UserInterface/Controllers/TimelineManager.js: (WebInspector.TimelineManager.defaultInstruments): (WebInspector.TimelineManager.prototype.memoryTrackingStart): (WebInspector.TimelineManager.prototype.memoryTrackingUpdate): (WebInspector.TimelineManager.prototype.memoryTrackingComplete): Create Memory timeline records from Memory tracking updates. * UserInterface/Models/MemoryCategory.js: (WebInspector.MemoryCategory): Consolidate some of the raw data of categories we get from the backend into a set of 4 user-facing categories. * UserInterface/Models/MemoryTimelineRecord.js: Added. (WebInspector.MemoryTimelineRecord): (WebInspector.MemoryTimelineRecord.memoryCategoriesFromProtocol): (WebInspector.MemoryTimelineRecord.prototype.get timestamp): (WebInspector.MemoryTimelineRecord.prototype.get categories): (WebInspector.MemoryTimelineRecord.prototype.get totalSize): (WebInspector.MemoryTimelineRecord.prototype.get startTime): (WebInspector.MemoryTimelineRecord.prototype.get endTime): Memory timeline record for the event data. * UserInterface/Models/MemoryInstrument.js: (WebInspector.MemoryInstrument): (WebInspector.MemoryInstrument.supported): (WebInspector.MemoryInstrument.prototype.get timelineRecordType): (WebInspector.MemoryInstrument.prototype.startInstrumentation): (WebInspector.MemoryInstrument.prototype.stopInstrumentation): Instrument to start / stop memory tracking. * UserInterface/Models/TimelineRecord.js: Add a new "Memory" Timeline type. * UserInterface/Views/ContentView.js: (WebInspector.ContentView.createFromRepresentedObject): * UserInterface/Models/TimelineRecording.js: (WebInspector.TimelineRecording): Add the new "Memory" Timeline. (WebInspector.TimelineRecording.prototype.addRecord): Memory timeline records do not show in the SourceCode Timelines Overview. * UserInterface/Views/CircleChart.css: (.circle-chart): (.circle-chart > svg > path.background): (.circle-chart > .center): * UserInterface/Views/CircleChart.js: Added. (WebInspector.CircleChart): (WebInspector.CircleChart.prototype.get element): (WebInspector.CircleChart.prototype.get points): (WebInspector.CircleChart.prototype.get size): (WebInspector.CircleChart.prototype.get centerElement): (WebInspector.CircleChart.prototype.get segments): (WebInspector.CircleChart.prototype.set segments): (WebInspector.CircleChart.prototype.get values): (WebInspector.CircleChart.prototype.set values): (WebInspector.CircleChart.prototype.clear): (WebInspector.CircleChart.prototype.needsLayout): (WebInspector.CircleChart.prototype.updateLayout): (WebInspector.CircleChart.prototype._needsLayout): (WebInspector.CircleChart.prototype._createCompleteCirclePathData): (WebInspector.CircleChart.prototype._createSegmentPathData): (WebInspector.CircleChart.prototype._updateLayout): Standalone circle "donut" chart, copied mostly from Rendering Frames Timeline. Initialize the chart's segments, then feed it a set of ([v1, v2, ...]) values corresponding to each of the segments. * UserInterface/Views/LineChart.js: Added. (WebInspector.LineChart): (WebInspector.LineChart.prototype.get element): (WebInspector.LineChart.prototype.get points): (WebInspector.LineChart.prototype.get size): (WebInspector.LineChart.prototype.set size): (WebInspector.LineChart.prototype.addPoint): (WebInspector.LineChart.prototype.clear): (WebInspector.LineChart.prototype.needsLayout): (WebInspector.LineChart.prototype.updateLayout): (WebInspector.LineChart.prototype._needsLayout): (WebInspector.LineChart.prototype._updateLayout): Standalone line chart. Uses a single SVG path, given a set of (x, y) points. * UserInterface/Views/StackedLineChart.js: Added. (WebInspector.StackedLineChart): (WebInspector.StackedLineChart.prototype.get element): (WebInspector.StackedLineChart.prototype.get points): (WebInspector.StackedLineChart.prototype.get size): (WebInspector.StackedLineChart.prototype.set size): (WebInspector.StackedLineChart.prototype.initializeSections): (WebInspector.StackedLineChart.prototype.addPointSet): (WebInspector.StackedLineChart.prototype.clear): (WebInspector.StackedLineChart.prototype.needsLayout): (WebInspector.StackedLineChart.prototype.updateLayout): (WebInspector.StackedLineChart.prototype._needsLayout): (WebInspector.StackedLineChart.prototype._updateLayout): Standalone stacked line chart. Initialize the chart's sections, then feed it a set of (x, [y1, y2 ...]) points where the y values correspond to each of the sections. * UserInterface/Views/TimelineOverview.js: (WebInspector.TimelineOverview.prototype.get scrollContainerWidth): Add a way to get this value without forcing layout all the time. * UserInterface/Views/TimelineTabContentView.js: (WebInspector.TimelineTabContentView.displayNameForTimeline): (WebInspector.TimelineTabContentView.iconClassNameForTimeline): (WebInspector.TimelineTabContentView.genericClassNameForTimeline): (WebInspector.TimelineTabContentView.iconClassNameForRecord): (WebInspector.TimelineTabContentView.displayNameForRecord): Add placeholders for the new Memory Timeline Type. * UserInterface/Views/MemoryCategoryView.css: (.memory-category-view): (.memory-category-view > .details): (.memory-category-view > .details > .name): (.memory-category-view > .graph): * UserInterface/Views/MemoryCategoryView.js: Added. (WebInspector.MemoryCategoryView): (WebInspector.MemoryCategoryView.prototype.get element): (WebInspector.MemoryCategoryView.prototype.get category): (WebInspector.MemoryCategoryView.prototype.clear): (WebInspector.MemoryCategoryView.prototype.layoutWithDataPoints): (WebInspector.MemoryCategoryView.prototype._updateDetails): * UserInterface/Views/MemoryTimelineOverviewGraph.css: (body .timeline-overview > .graphs-container > .timeline-overview-graph.memory): (.timeline-overview-graph.memory): (.timeline-overview-graph.memory > .legend): (.timeline-overview-graph.memory > .stacked-line-chart > svg > path.javascript): (.timeline-overview-graph.memory > .stacked-line-chart > svg > path.images): (.timeline-overview-graph.memory > .stacked-line-chart > svg > path.layers): (.timeline-overview-graph.memory > .stacked-line-chart > svg > path.page): * UserInterface/Views/MemoryTimelineOverviewGraph.js: Added. (WebInspector.MemoryTimelineOverviewGraph): (WebInspector.MemoryTimelineOverviewGraph.prototype.get height): (WebInspector.MemoryTimelineOverviewGraph.prototype.reset): (WebInspector.MemoryTimelineOverviewGraph.prototype.layout.timeToX): (WebInspector.MemoryTimelineOverviewGraph.prototype.layout.sizeToY): (WebInspector.MemoryTimelineOverviewGraph.prototype.layout.sizesToYs): (WebInspector.MemoryTimelineOverviewGraph.prototype.layout.ysForRecord): (WebInspector.MemoryTimelineOverviewGraph.prototype.layout): (WebInspector.MemoryTimelineOverviewGraph.prototype._updateLegend): (WebInspector.MemoryTimelineOverviewGraph.prototype._visibleRecords): (WebInspector.MemoryTimelineOverviewGraph.prototype._memoryTimelineRecordAdded): * UserInterface/Views/MemoryTimelineView.css: Added. (.timeline-view.memory): (.timeline-view.memory > .content): (.timeline-view.memory > .content > .overview): (.timeline-view.memory > .content .title): (.timeline-view.memory > .content .subtitle): (.timeline-view.memory > .content > .details > .timeline-ruler): (.timeline-view.memory > .content > .details > .subtitle): (.timeline-view.memory > .content > .overview > .chart): (.timeline-view.memory > .content > .overview > .chart > .subtitle): (.timeline-view.memory > .content > .overview > .chart > .container): (.timeline-view.memory > .content > .overview > .divider): (.timeline-view.memory > .content > .overview .max-percentage): (.timeline-view.memory .legend): (.timeline-view.memory .legend > .row): (.timeline-view.memory .legend > .row > .swatch): (.timeline-view.memory .legend > .row > p): (.timeline-view.memory .legend > .row > .label): (.timeline-view.memory .legend > .row > .size): (.timeline-view.memory .legend > .row > .swatch.javascript): (.timeline-view.memory .legend > .row > .swatch.images): (.timeline-view.memory .legend > .row > .swatch.layers): (.timeline-view.memory .legend > .row > .swatch.page): (.memory-category-view.javascript .line-chart > svg > path): (.memory-category-view.images .line-chart > svg > path): (.memory-category-view.layers .line-chart > svg > path): (.memory-category-view.page .line-chart > svg > path): (.timeline-view.memory .legend > .row > .swatch.current): (.timeline-view.memory .circle-chart > svg > path.current): (.timeline-view.memory .circle-chart > svg > path.remainder): * UserInterface/Views/MemoryTimelineView.js: Added. (WebInspector.MemoryTimelineView): (WebInspector.MemoryTimelineView.displayNameForCategory): (WebInspector.MemoryTimelineView.prototype.get navigationSidebarTreeOutlineLabel): (WebInspector.MemoryTimelineView.prototype.shown): (WebInspector.MemoryTimelineView.prototype.hidden): (WebInspector.MemoryTimelineView.prototype.closed): (WebInspector.MemoryTimelineView.prototype.reset): (WebInspector.MemoryTimelineView.prototype.treeElementPathComponentSelected): (WebInspector.MemoryTimelineView.prototype.layout.timeToX): (WebInspector.MemoryTimelineView.prototype.layout.sizeToY): (WebInspector.MemoryTimelineView.prototype.layout.layoutCategoryView): (WebInspector.MemoryTimelineView.prototype.layout): (WebInspector.MemoryTimelineView.prototype._clearUsageLegend): (WebInspector.MemoryTimelineView.prototype._updateUsageLegend): (WebInspector.MemoryTimelineView.prototype._clearMaxComparisonLegend): (WebInspector.MemoryTimelineView.prototype._updateMaxComparisonLegend): (WebInspector.MemoryTimelineView.prototype._visibleRecords): (WebInspector.MemoryTimelineView.prototype._initializeCategoryViews.appendLegendRow): (WebInspector.MemoryTimelineView.prototype._initializeCategoryViews): (WebInspector.MemoryTimelineView.prototype._memoryTimelineRecordAdded): * UserInterface/Views/Variables.css: (:root): Memory timeline view styles. Source/WebKit/mac: * Configurations/FeatureDefines.xcconfig: Source/WebKit2: * Configurations/FeatureDefines.xcconfig: LayoutTests: * inspector/memory/tracking-expected.txt: Added. * inspector/memory/tracking.html: Added. Basic test for the new domain tracking commands and events. * platform/efl/TestExpectations: * platform/gtk/TestExpectations: * platform/win/TestExpectations: Skip the directory on ports that have not implemented ENABLE(RESOURCE_USAGE). Canonical link: https://commits.webkit.org/171861@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195999 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-02-02 01:52:16 +00:00
Memory.trackingStart
PASS: Should have a timestamp when starting.
Memory.trackingUpdate
PASS: Should have an event object.
PASS: Event should have a timestamp.
PASS: Event should have category data.
PASS: Total size should be non-zero.
CATEGORIES: images, javascript, jit, layers, other, page
Memory.trackingComplete