-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Guide] Integration with existing e2e framework #35
Comments
@unlikelyzero Sure, the integration may consists of two steps: Get heap snapshot dumped onto disk with certain directory structure and meta filesFor your existing playwright/test framework, I would suggest implementing an API that takes JS heap snapshots from the browser. It seems playwright supports connecting with the Browser's DevTools via the Chrome DevTools Protocol (link). So you can leverage this to take JS heap snapshots from Chromium. Here is the code pointer of how memlab uses puppeteer to collect the heap snapshots from Chromium. The API could look like this (as an example): await takeJSHeapSnapshot(page, tag);
Your
To get examples of those meta files, run a random MemLab test scenario and view those files under this directory: In your Playwright test code, you can insert those Find memory leaks based on heap snapshot dumps and meta filesOnce you have the const {findLeaks, BrowserInteractionResultReader} = require('@memlab/api');
(async function () {
const reader = BrowserInteractionResultReader.from('/path/to/dump/');
const leaks = await findLeaks(reader);
})(); |
@JacksonGL Can you pls help how to generate the Also can you explain what is the use of these files. |
@ajayjaggi97 i have not integrated this yet |
I would love to understand the extra 2 files as well... |
Recent updates have made the
|
…ing frameworks Summary: This diff adds a new documentation page for how to integrate E2E testing framework with MemLab. In case anyone wants to detect memory leaks by running tests in other E2E testing frameworks such as Playwright or Cypress etc. Related to #35, #15, #14 Reviewed By: tulga1970 Differential Revision: D47247084 fbshipit-source-id: 0620defa7114bf77e3248472b424541f8cec481b
@JacksonGL we finally were able to start the integration. We have a rough POC based on your advice here: We're seeing the following when executing
|
const {findLeaks, BrowserInteractionResultReader} = require('@memlab/api');
(async function () {
const reader = BrowserInteractionResultReader.from('/path/to/dump/');
const leaks = await findLeaks(reader);
})(); Also make sure that the specified directory contains the files mentioned in this previous reply. If it still shows an error, can you zip the directory and share it with me so I can debug it. |
@unlikelyzero The PR needs to change the heap dump directory structure a little bit and add a static This should work, let me know how it goes |
…ased on heap snapshots Summary: This diff adds a new `SnapshotResultReader` extending the `BaseResultReader` base class so that we can use the `findLeaks(reader)` API to detect memory leaks when we only have three snapshots taken manually (without the other meta data generated by memlab run) Here is an example code snippet on how it could be used: ``` const {SnapshotResultReader, findLeaks} = require('memlab/api'); // baseline, target, and final are file paths of heap snapshot files const reader = SnapshotResultReader.fromSnapshots(baseline, target, final); const leaks = await findLeaks(reader); ``` Related #35 Differential Revision: D48510720 fbshipit-source-id: 2bada7192ad7f6d99356666b62878c89d7021ffb
Hello! This project looks amazing and is something our team at NASA Open MCT would love to used within our nascent performance testing suite.
I've seen a few requests for integration #15 and #14.
We're leveraging the playwright/test package which is nearly identical to jest+puppeteer in terms of capabilities. The only missing API from puppeteer is microsoft/playwright#14134 , but otherwise has API parity and should be interchangeable.
I was wondering if you could provide a guide on how to integrate memlab into our existing playwright/test framework. I could help keep it up to date by integrating these two projects as part of our CI pipeline. I'd just like to know about how we should go about getting started using some of your core APIs. Thanks!
The text was updated successfully, but these errors were encountered: