Skip to content

Adding a no-backend option for checking a site #792

Open
@mrchrisadams

Description

Hi folks, I'm creating this issue as a result of some discussion in PR 487 on the Wagtail bakery Demo repo.

Here's the key quote:

Qn1. Is there a way to manually trigger a run for a given project to see how it's working, outside of pushing new code to a branch?

I'm thinking of something along the lines of the use case in the original README for @thibaudcolas 's fork - where he demonstrated how to run a specific scenario on their remote dedicated testing hardware. A bit like this:

greenframe analyze http://localhost:8000/ homepage-landing.js

The idea here is that spinning up a full docker container, with browser and puppeteer is more than many teams are able to take on, but also getting the directly measured energy figures from a browser itself is a useful thing, that many existing tools don't offer.

The only example I DO know that supports exposing CPU usage figures is Sitespeed.io (see this issue for more), and that works by using Firefox's own profiler's own per-process figures, rather than inspecting the whole machine from the outside. When I spoke to the Firefox folks, I think that because it uses a per-process focussed approach that lists only processes the browser "owns", it was harder to see when work was offloaded to a GPU, like for video and so on.

However, please don't take that at face value though - I'm not sure if that is correct.

Anyway, something a bit like this would be really helpful and I think lower the barrier to starting with GMT:

gmt one-off focussed-usage-scenario.yml green-coding-puppeteer-container https://path-to-website-to-check

Where:

  • gmt is probably some nice binary CLI alias to sending a modified HTTP request to the GMT server API, requesting a one-off run
  • one-off is a one-off test subcommand (inspired by the current GMT API)
    • focussed-usage-scenario.yml might be a usage scanario as already defined in GMT,
  • green-coding-puppeteer-container is a predefined label for docker container. As far as I can tell, these docker container labels that would always be present even if you are reusing a docker compose file anyway in a usage_scenario.yml. To make things specific, the wagtail PR linked above has the docker container containing the browser as green-coding-puppeteer-container
  • https://path-to-website-to-check is the domain to check. I think puppeteer and playright assume a single domain by default - hence making the domain explicit.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions