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

vod: vodloadtester (DirectUploads, ResumableUploads, Import) #197

Open
wants to merge 25 commits into
base: master
Choose a base branch
from

Conversation

gioelecerati
Copy link
Member

@gioelecerati gioelecerati commented Sep 15, 2022

  • Direct uploads load test
  • Resumable uploads load test
  • Import from url load test
  • Import from a .json file containing a list of remote files (ipfs, https)
  • Upload files from a folder
  • Save results with success / fail in steps, with error messages coming from the pipeline

Notion doc for usage:
https://www.notion.so/livepeer/How-to-run-a-VOD-load-test-using-vodloadtester-0b3db771393a46a384ce7e05b614150a#4fa99de44d34404fb134c515c48faf93

Usage of vodloadtester:
  -api-server string
    	Server of the Livepeer API to be used (default "origin.livepeer.monster")
  -api-token string
    	Token of the Livepeer API to be used
  -config string
    	config file (optional)
  -delay-between-groups duration
    	Delay between starting group of uploads (default 10s)
  -direct
    	Launch direct upload test
  -file string
    	File to upload or url to import. Can be either a video or a .json array of objects with a url key
  -folder string
    	Folder with files to upload. The tester will search in the folder for files with the following extensions: mp4
  -import
    	Launch import from url test
  -keep-assets
    	Keep assets after test
  -output-path string
    	Path to output result .ndjson file (default "/tmp/results.ndjson")
  -probe-data
    	Write object data in results when importing a JSON file
  -resumable
    	Launch tus upload test
  -sim uint
    	Number of simulteneous videos to upload or import (batch size) (default 1)
  -task-check
    	Check task processing
  -task-poll-time uint
    	Task check poll time in seconds (default 5)
  -task-timeout uint
    	Task check timeout in seconds (default 500)
  -v int
    	Log verbosity.  {4|5|6} (default 5)
  -version
    	Print out the version
  -video-amt uint
    	How many video to upload or import (default 1)

Example output:

{"start_time":"2022-09-16T20:30:29.171494319+02:00","end_time":"2022-09-16T20:30:50.362233778+02:00","runnerInfo":"Hostname gioele-XPS-15-9510 OS linux","kind":"resumable","assetId":"f5e5cbd3-8179-4a65-acb8-29707f96f780","taskId":"4268d966-3819-4ec2-81c6-4c6da5691e99","requestUploadSuccess":1,"uploadSuccess":1,"taskCheckSuccess":1}
{"start_time":"2022-09-16T20:30:29.171489196+02:00","end_time":"2022-09-16T20:30:50.393028209+02:00","runnerInfo":"Hostname gioele-XPS-15-9510 OS linux","kind":"resumable","assetId":"3a03fafc-a186-45c9-a6d6-c238c0f419a9","taskId":"a44ed917-40ec-4308-baef-353d7f1d6b07","requestUploadSuccess":1,"uploadSuccess":1,"taskCheckSuccess":1}
{"start_time":"2022-09-16T20:30:44.172579442+02:00","end_time":"2022-09-16T20:31:04.380322533+02:00","runnerInfo":"Hostname gioele-XPS-15-9510 OS linux","kind":"resumable","assetId":"76b2b2dc-9473-4512-80bf-a8359b3ecf6f","taskId":"5e5fd631-8e7f-4724-9590-e92fcd31d60e","requestUploadSuccess":1,"uploadSuccess":1,"taskCheckSuccess":1}
{"start_time":"2022-09-16T20:30:44.172512413+02:00","end_time":"2022-09-16T20:31:04.405383898+02:00","runnerInfo":"Hostname gioele-XPS-15-9510 OS linux","kind":"resumable","assetId":"b0c168c0-177a-49f6-87d3-09966d41e5d0","taskId":"a12b9672-3d7e-4bb1-a037-2c90d101d795","requestUploadSuccess":1,"uploadSuccess":1,"taskCheckSuccess":1}
{"start_time":"2022-09-16T20:30:59.175543883+02:00","end_time":"2022-09-16T20:31:14.582551084+02:00","runnerInfo":"Hostname gioele-XPS-15-9510 OS linux","kind":"resumable","assetId":"c5ea0148-8c2f-4760-a324-e432ba112bc0","taskId":"1571a2a9-17b5-4b6a-b95e-625f3e07dd68","requestUploadSuccess":1,"uploadSuccess":1,"taskCheckSuccess":1}

@gioelecerati gioelecerati requested a review from a team as a code owner September 15, 2022 01:43
@gioelecerati gioelecerati marked this pull request as draft September 15, 2022 01:43
@gioelecerati gioelecerati marked this pull request as ready for review September 16, 2022 17:36
@gioelecerati gioelecerati changed the title vod: added vodloadtester draft vod: vodloadtester (DirectUploads, ResumableUploads, Import) Sep 16, 2022
@gioelecerati
Copy link
Member Author

Fixes livepeer/studio#1211

StartDelayDuration time.Duration
}

type vodLoadTester struct {
Copy link
Member

Choose a reason for hiding this comment

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

Could we move this struct to its own package under internal/app/vodloadtester? That's the pattern we've been following in this project, and I think it's indeed cleaner to separate the business logic of the load tester from the code that only deals with the "command line interface" parsing/serializing of results etc.

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.

sorry had to send a partial review tuesday on a rush. coming back to this now

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.

Overall LGTM, but the concurrency logic needs some fixes

return err
}

func (vt *vodLoadTester) checkTaskProcessing(taskPollDuration time.Duration, processingTask api.TaskOnlyId) error {
Copy link
Member

Choose a reason for hiding this comment

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

Feel like we have this function repeated somewhere else 🤔

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!


}

func (vt *vodLoadTester) importFromJSON(jsonFile string, runnerInfo string) {
Copy link
Member

Choose a reason for hiding this comment

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

Coooool

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.

2 participants