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 Realtime Viewership API #185

Merged
merged 31 commits into from
Mar 13, 2024
Merged

Conversation

leszko
Copy link
Contributor

@leszko leszko commented Mar 7, 2024

API Spec

Changes:

  • Add api handler for Realtime Viewership API
  • Add flags to pass Clickhouse Credentials
  • Add Clickhouse Client
  • Refactor QuerySpec parsing (to re-use in other APIs)

fix https://linear.app/livepeer/issue/ENG-1652/implement-api-to-deliver-real-time-data

Copy link

codecov bot commented Mar 7, 2024

Codecov Report

Attention: Patch coverage is 17.12329% with 121 lines in your changes are missing coverage. Please review.

Project coverage is 28.64721%. Comparing base (1798dc0) to head (9203ba8).

Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                 @@
##                main        #185         +/-   ##
===================================================
- Coverage   28.99628%   28.64721%   -0.34907%     
===================================================
  Files              5           6          +1     
  Lines            269         377        +108     
===================================================
+ Hits              78         108         +30     
- Misses           180         256         +76     
- Partials          11          13          +2     
Files Coverage Δ
views/query_spec.go 71.42857% <ø> (+71.42857%) ⬆️
views/client.go 19.37984% <35.21127%> (+19.37984%) ⬆️
views/clickhouse.go 0.00000% <0.00000%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1798dc0...9203ba8. Read the comment docs.

Files Coverage Δ
views/query_spec.go 71.42857% <ø> (+71.42857%) ⬆️
views/client.go 19.37984% <35.21127%> (+19.37984%) ⬆️
views/clickhouse.go 0.00000% <0.00000%> (ø)

Copy link

linear bot commented Mar 11, 2024

@leszko leszko requested review from thomshutt and victorges March 11, 2024 12:49
@leszko leszko marked this pull request as ready for review March 11, 2024 12:49
@leszko leszko requested a review from a team as a code owner March 11, 2024 12:49
Copy link
Member

@ecmulli ecmulli left a comment

Choose a reason for hiding this comment

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

I have some comments that need to be addressed but can happen after merging if we need to get this into staging asap.

Copy link
Member

@victorges victorges left a comment

Choose a reason for hiding this comment

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

LGTM either way but made a couple suggestions. The only higher-level issue I have is with the historical metrics being exposed on the same endpoint as the realtime metrics, as I think that can be confusing for using and maintaining this.

@leszko
Copy link
Contributor Author

leszko commented Mar 13, 2024

@ecmulli @victorges Thanks for all the comments. I addressed most of them. Planning to merge this PR and open the discussion in Discord.

@leszko leszko merged commit 3cf1819 into main Mar 13, 2024
13 checks passed
@leszko leszko deleted the rafal/analytics-realtime-viewership branch March 13, 2024 11:34
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