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

[ENHANCEMENT] Add a new spanner table for Latest usage metrics #866

Open
jcscottiii opened this issue Nov 5, 2024 · 0 comments
Open

[ENHANCEMENT] Add a new spanner table for Latest usage metrics #866

jcscottiii opened this issue Nov 5, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@jcscottiii
Copy link
Collaborator

As the number of metrics we store grows, getting the latest metrics can be costly. Spanner does not implement window functions[1][2].

We ran into this problem when we stored WPT Run metrics a lot sooner due to the vast number of metrics from WPT being stored. We solved it by doing option 2.

We should do the same with the usage data as well.

Definition of done:

  1. Create a table, LatestDailyChromiumHistogramMetrics
  • Should have:
    • WebFeatureID (Primary Key and have it as a Foreign Key with WebFeatures(ID))
    • ChromiumHistogramEnumValueID (Foreign Key with DailyChromiumHistogramMetrics as it is the primary key part 1 from DailyChromiumHistogramMetrics)
    • Day (Foreign Key with DailyChromiumHistogramMetrics as it is the primary key part 1 from DailyChromiumHistogramMetrics)
  1. Modify the base query to reduce the joins. It should be able to join with the existing wf.ID to the WebFeatureID in this new table and then return the rate.
  2. Update the UpsertDailyChromiumHistogramMetric logic to conditionally update the Latest table. Similar to the WPT metrics

Inspiration can be taken from the Latest WPT Metrics table: #498

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 2024-Q4
Development

No branches or pull requests

1 participant