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

Document EventCounts API #21516

Merged
merged 1 commit into from
Oct 13, 2022
Merged

Document EventCounts API #21516

merged 1 commit into from
Oct 13, 2022

Conversation

Elchi3
Copy link
Member

@Elchi3 Elchi3 commented Oct 12, 2022

Description

This PR documents a neat little API that allows you to get counts for events via performance.eventCounts.

EventCounts is basically a Map but readonly. I don't think we should have sub pages there. I pointed to the Map docs instead.

The list of event types that are possible to count here are listed on https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEventTiming. That list looks a bit lost but I want to create a separate PR to properly document PerformanceEventTiming. Stay tuned ;)

Motivation

This has been supported in Firefox and Chrome for a while.
Also contributes to the request made by the Performance WG to update MDN perf API docs, see openwebdocs/project#62

Additional details

It seems that https://developer.mozilla.org/en-US/docs/Web/API/MIDIInputMap is some prior art on documenting readonly maplike interfaces, but I think that page is quite thin.

Related issues and pull requests

I made a BCD PR to fix spec_urls, mdn_urls and standard statuses, see mdn/browser-compat-data#17989

@Elchi3 Elchi3 requested a review from a team as a code owner October 12, 2022 20:23
@Elchi3 Elchi3 requested review from sideshowbarker and removed request for a team October 12, 2022 20:23
@github-actions github-actions bot added the Content:WebAPI Web API docs label Oct 12, 2022
@github-actions
Copy link
Contributor

Preview URLs

Flaws (1)

Note! 2 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Web/API/Performance
Title: Performance
Flaw count: 1

  • macros:
    • /en-US/docs/Web/API/Window/performance redirects to /en-US/docs/Web/API/performance_property

Copy link
Contributor

@teoli2003 teoli2003 left a comment

Choose a reason for hiding this comment

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

This is clearly better. We can discuss how to document readonly maplike<> in the future (as well as setlike<>: I think we should document the pages as they are not real maps, and it can be confusing for a beginner developer. (Though we should solve the extra work by having a working template generator)

But no need to hold this now, as it is much better than before.

@teoli2003 teoli2003 merged commit a72ee1c into mdn:main Oct 13, 2022
@Elchi3 Elchi3 deleted the eventcounts branch October 13, 2022 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants