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

api/views: Better separate summary from events queries #132

Merged
merged 2 commits into from
May 12, 2023

Conversation

victorges
Copy link
Member

I found out after the initial version that the viewership summary and viewership
events tables don't actually have the same data: the summary one has the
prometheus data backward compatibility while the events one does not.

To make that distinction clearer to the end-user, added a new metric on the
summary query responses called legacyViewCount, which contains the
number of views that have been migrated from the prometheus data and
thus will not show up in the detailed query endpoints.

Also removed a refactor that did a cheaper summary query when the
events query was made with just a playback ID. This is not possible anymore,
since the tables contain different data, so we cannot replace one query with
the other.

The coded ended up a little simpler tho, without magic attempt to detect what
kind of query it is, which could also lead to unexpected bugs like something
changing and we stopping the use of the summary table altogether.

@victorges victorges requested a review from a team as a code owner May 11, 2023 22:36
@gioelecerati
Copy link
Member

LGTM

@victorges victorges merged commit 1d6a61e into main May 12, 2023
10 of 11 checks passed
@victorges victorges deleted the vg/feat/legacy-views branch May 12, 2023 16:14
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.

None yet

2 participants