You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe that #590 best captures the original intent of the RFE and was closed before playwright became widely adopted.
Since 2021, there have been several projects which leverage puppeteer's native metrics API and could/would switch to using playwright-core if the API became native:
We are developing our own shim until this API becomes available and would be willing to take on the work on porting this API from puppeteer to playwright if necessary.
The text was updated successfully, but these errors were encountered:
/*** Return a performance metric from the chrome cdp session.* Note: Chrome-only* @param {object} page page to attach cdpClient* @param {String} metricName the name of the metric to be extracted* @return {Object}* @see {@link https://github.com/microsoft/playwright/issues/18071 Github RFE}*/asyncfunctiongetMetrics(page){letclient;client=awaitpage.context().newCDPSession(page);awaitclient.send('Performance.enable');constperfMetricObject=awaitclient.send('Performance.getMetrics');constextractedMetric=perfMetricObject?.metrics;constmetricObject=extractedMetric.reduce((acc,{name, value})=>{acc[name]=value;returnacc;},{});returnmetricObject;}
Playwright does not currently support a native metrics API made available in puppeteer. https://pptr.dev/api/puppeteer.page.metrics/
This has been filed in a few ways:
#16711 and #590
I believe that #590 best captures the original intent of the RFE and was closed before playwright became widely adopted.
Since 2021, there have been several projects which leverage puppeteer's native metrics API and could/would switch to using playwright-core if the API became native:
nolanlawson/fuite#44
facebook/memlab#35
We are developing our own shim until this API becomes available and would be willing to take on the work on porting this API from puppeteer to playwright if necessary.
The text was updated successfully, but these errors were encountered: