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: Add scheduledAt field to tasks to allow proper time-to-ready metric #1667

Merged
merged 8 commits into from
Mar 23, 2023

Conversation

victorges
Copy link
Member

What does this pull request do? Explain your changes. (required)
This adds a scheduledAt field to tasks so we can tell how long an asset
actually took to upload then how long it actually took to be processed.

upload time = task->scheduledAt - task->createdAt
time to ready = task->status->updatedAt - task->scheduledAt

On the way, also added an uploading phase to assets cause we need that for too long already.

Specific updates (required)

  • Add scheduledAt field to tasks and udpate them from scheduler
  • Add uploading phase to assets and update it from controller
  • Rename scheduler task scheduling functions

How did you test each of these updates (required)
in yarn tests we trust

Does this pull request close any open issues?
Implements API-31

Checklist

  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@victorges victorges requested a review from a team as a code owner March 10, 2023 19:21
@vercel
Copy link

vercel bot commented Mar 10, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
livepeer-studio ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 22, 2023 at 8:20PM (UTC)

Copy link
Member

@gioelecerati gioelecerati left a comment

Choose a reason for hiding this comment

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

LGTM!

packages/api/src/task/scheduler.ts Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Mar 22, 2023

Codecov Report

Merging #1667 (f2c9cb2) into master (9bf4d71) will increase coverage by 0.03705%.
The diff coverage is 65.38462%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##              master       #1667         +/-   ##
===================================================
+ Coverage   53.13268%   53.16973%   +0.03705%     
===================================================
  Files             74          74                 
  Lines           4884        4890          +6     
  Branches         941         944          +3     
===================================================
+ Hits            2595        2600          +5     
  Misses          1961        1961                 
- Partials         328         329          +1     
Impacted Files Coverage Δ
packages/api/src/webhooks/cannon.ts 46.28571% <0.00000%> (ø)
packages/api/src/controllers/asset.ts 58.80682% <64.70588%> (+0.47349%) ⬆️
packages/api/src/task/scheduler.ts 50.00000% <71.42857%> (ø)
packages/api/src/controllers/transcode.ts 91.66667% <100.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 9bf4d71...f2c9cb2. Read the comment docs.

Impacted Files Coverage Δ
packages/api/src/webhooks/cannon.ts 46.28571% <0.00000%> (ø)
packages/api/src/controllers/asset.ts 58.80682% <64.70588%> (+0.47349%) ⬆️
packages/api/src/task/scheduler.ts 50.00000% <71.42857%> (ø)
packages/api/src/controllers/transcode.ts 91.66667% <100.00000%> (ø)

@victorges victorges merged commit dd1126f into master Mar 23, 2023
@victorges victorges deleted the vg/feat/uploaded-at branch March 23, 2023 15:30
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