diff --git a/src/profile-logic/import/chrome.js b/src/profile-logic/import/chrome.js index efc563ffb1..9b3d8552de 100644 --- a/src/profile-logic/import/chrome.js +++ b/src/profile-logic/import/chrome.js @@ -948,6 +948,21 @@ function extractMarkers( }, ], }, + { + name: 'Text', + tooltipLabel: '{marker.name}', + tableLabel: '{marker.name} — {marker.data.text}', + chartLabel: '{marker.data.text}', + display: ['marker-chart', 'marker-table'], + data: [ + { + key: 'text', + label: 'Description', + format: 'string', + searchable: true, + }, + ], + }, ]; for (const [name, events] of eventsByName.entries()) { @@ -1001,21 +1016,69 @@ function extractMarkers( if (event.args && typeof event.args === 'object') { argData = (event.args: any).data || null; } - markers.name.push(stringTable.indexForString(name)); + markers.category.push(otherCategoryIndex); + let newData = {}; + const prefixes = [ + 'Apply build file', + 'Apply initialization script', + 'Apply plugin', + 'Apply script', + 'Apply settings file', + 'Calculate build tree task graph', + 'Calculate task graph', + 'Configure build', + 'Configure project', + 'Compile build file', + 'Compile script', + 'Cross-configure project', + 'Download', + 'Evaluate settings', + 'Execute countainer callback action', + 'Execute', + 'Executing', + 'Finalize build cache configuration', + 'Fingerprint transform inputs', + 'Finish root build tree', + 'Identifying work', + 'Load build', + 'Load projects', + 'Notify afterEvaluate listeners', + 'Notify beforeEvaluate listeners', + 'Notify projectsEvaluated listeners', + 'Notify projectsLoaded listeners', + 'Notify task graph', + 'Realize task', + 'Register task', + 'Resolve dependencies of', + 'Resolve files of configuration', + 'Resolve', + 'Run init scripts', + 'Run main tasks', + 'Snapshot', + 'Toolchain detection', + ]; + const prefix = prefixes.find((p) => name.startsWith(p)); + if (prefix) { + newData.type = 'Text'; + newData.text = name.slice(prefix.length + 1); + markers.name.push(stringTable.indexForString(prefix)); + } else { + markers.name.push(stringTable.indexForString(name)); - if (argData && 'type' in argData) { - argData.type2 = argData.type; - } - if (argData && 'category' in argData) { - argData.category2 = argData.category; - } + if (argData && 'type' in argData) { + argData.type2 = argData.type; + } + if (argData && 'category' in argData) { + argData.category2 = argData.category; + } - const newData = { - ...argData, - type: name, - category: event.cat, - }; + newData = { + ...argData, + type: name, + category: event.cat, + }; + } // $FlowExpectError Opt out of Flow checking for this one. markers.data.push(newData); diff --git a/src/test/unit/__snapshots__/profile-conversion.test.js.snap b/src/test/unit/__snapshots__/profile-conversion.test.js.snap index 51aeb0ab04..bfbdced1f6 100644 --- a/src/test/unit/__snapshots__/profile-conversion.test.js.snap +++ b/src/test/unit/__snapshots__/profile-conversion.test.js.snap @@ -334624,6 +334624,24 @@ Object { "tableLabel": "{marker.data.type2}", "tooltipLabel": "{marker.data.type2} - EventDispatch", }, + Object { + "chartLabel": "{marker.data.text}", + "data": Array [ + Object { + "format": "string", + "key": "text", + "label": "Description", + "searchable": true, + }, + ], + "display": Array [ + "marker-chart", + "marker-table", + ], + "name": "Text", + "tableLabel": "{marker.name} — {marker.data.text}", + "tooltipLabel": "{marker.name}", + }, ], "misc": "", "oscpu": "", @@ -382999,6 +383017,24 @@ Object { "tableLabel": "{marker.data.type2}", "tooltipLabel": "{marker.data.type2} - EventDispatch", }, + Object { + "chartLabel": "{marker.data.text}", + "data": Array [ + Object { + "format": "string", + "key": "text", + "label": "Description", + "searchable": true, + }, + ], + "display": Array [ + "marker-chart", + "marker-table", + ], + "name": "Text", + "tableLabel": "{marker.name} — {marker.data.text}", + "tooltipLabel": "{marker.name}", + }, ], "misc": "", "oscpu": "", @@ -431374,6 +431410,24 @@ Object { "tableLabel": "{marker.data.type2}", "tooltipLabel": "{marker.data.type2} - EventDispatch", }, + Object { + "chartLabel": "{marker.data.text}", + "data": Array [ + Object { + "format": "string", + "key": "text", + "label": "Description", + "searchable": true, + }, + ], + "display": Array [ + "marker-chart", + "marker-table", + ], + "name": "Text", + "tableLabel": "{marker.name} — {marker.data.text}", + "tooltipLabel": "{marker.name}", + }, ], "misc": "", "oscpu": "", @@ -434204,6 +434258,24 @@ Object { "tableLabel": "{marker.data.type2}", "tooltipLabel": "{marker.data.type2} - EventDispatch", }, + Object { + "chartLabel": "{marker.data.text}", + "data": Array [ + Object { + "format": "string", + "key": "text", + "label": "Description", + "searchable": true, + }, + ], + "display": Array [ + "marker-chart", + "marker-table", + ], + "name": "Text", + "tableLabel": "{marker.name} — {marker.data.text}", + "tooltipLabel": "{marker.name}", + }, ], "misc": "", "oscpu": "", @@ -437140,6 +437212,24 @@ Object { "tableLabel": "{marker.data.type2}", "tooltipLabel": "{marker.data.type2} - EventDispatch", }, + Object { + "chartLabel": "{marker.data.text}", + "data": Array [ + Object { + "format": "string", + "key": "text", + "label": "Description", + "searchable": true, + }, + ], + "display": Array [ + "marker-chart", + "marker-table", + ], + "name": "Text", + "tableLabel": "{marker.name} — {marker.data.text}", + "tooltipLabel": "{marker.name}", + }, ], "misc": "", "oscpu": "", @@ -446084,6 +446174,24 @@ Object { "tableLabel": "{marker.data.type2}", "tooltipLabel": "{marker.data.type2} - EventDispatch", }, + Object { + "chartLabel": "{marker.data.text}", + "data": Array [ + Object { + "format": "string", + "key": "text", + "label": "Description", + "searchable": true, + }, + ], + "display": Array [ + "marker-chart", + "marker-table", + ], + "name": "Text", + "tableLabel": "{marker.name} — {marker.data.text}", + "tooltipLabel": "{marker.name}", + }, ], "misc": "", "oscpu": "",