Skip to content
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

Add API demo CLI tool #4

Closed
wants to merge 9 commits into from
Closed

Conversation

exterkamp
Copy link
Member

Adds a nodejs micro library to demo/api/ folder.

This is based on the code in the demo app code in the getting-started page with some Core Web Vitals flavor mixed in via the p75 data.

demos/api/core_web_vitals/README.md Outdated Show resolved Hide resolved
demos/api/core_web_vitals/main.js Outdated Show resolved Hide resolved
const labeledMetrics = await labelMetricData(json.record.metrics);

// The CWV 75%ile thresholds.
const nameToCWVMap = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can we make this more resilient to threshold changes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbh I'm not sure. We can look at the end of the first bucket of each metric. Which is the CWV threshold. But that isn't guaranteed to be true for all time.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But that isn't guaranteed to be true for all time.

nothing's a true guarantee, but at this point i can't imagine this would change.

eg the primary cwv image relies on this fact:
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At minimum, the threshold should not change before May 2021, and if it were to change (in 2021 or some other future CWV release) there'd be a coordinated effort to ensure all tools were updated accordingly.

demos/api/core_web_vitals/main.js Outdated Show resolved Hide resolved
demos/api/core_web_vitals/package.json Outdated Show resolved Hide resolved
demos/api/core_web_vitals/.gitignore Show resolved Hide resolved
demos/api/core_web_vitals/main.js Outdated Show resolved Hide resolved
demos/api/core_web_vitals/main.js Outdated Show resolved Hide resolved
demos/api/core_web_vitals/main.js Show resolved Hide resolved
demos/api/core_web_vitals/main.js Outdated Show resolved Hide resolved
@exterkamp exterkamp requested a review from rviscomi June 3, 2020 23:46
@exterkamp exterkamp closed this Jun 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants