marmelab / greenframe-cli

Estimate the carbon footprint of a user scenario on a web application
https://greenframe.io
Other
235 stars 12 forks source link

Scenario for comparison between GF-cli and GF-app single page app #88

Open benel opened 5 days ago

benel commented 5 days ago

Greetings,

As I create tutorials for my students to use your great tool, I realize how hard it is to create good scenarios for Greenframe:

I checked all the examples from the documentation and the end-to-end tests, but none have results as general and as good as those got from GreenFrame.IO single page project.

It seems that they wait both for events and for fixed duration.

I tried to design such a scenario. For now it is like this:

const visit = async (page) => {
  await page.goto('', {
      waitUntil: 'networkidle',
  });
  await page.waitForTimeout(10000);
  await page.scrollToEnd();
  await page.waitForNetworkIdle();
  await page.waitForTimeout(7000);
};

module.exports = visit;

For a "light-impact" application, Its results (fig.1) are quite similar to GreenFrame.IO single page project's (fig.2):

Image Image

But for a heavy-impact one, its results (fig.3) are still very different from GreenFrame.IO single page project's (fig.4):

Image Image

Would it be possible for you to disclose your single page scenario (in place of src/examples/visit.js or as documentation)?

It would provide a smoother learning process and would provide a way to compare results from the Web UI single page (typically for applications done by others) and from the cli (typically for application being developed and tested locally).

Best regards.