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

parallelize fetch-data (#106) #107

Merged
merged 3 commits into from
Oct 27, 2023
Merged

parallelize fetch-data (#106) #107

merged 3 commits into from
Oct 27, 2023

Conversation

willkg
Copy link
Collaborator

@willkg willkg commented Oct 27, 2023

This vastly improves fetch-data speed as it allows us to do something like this:

cat crashids.txt | fetch-data --workers=5 crashdata

It defaults to 1 worker (serial). It requires a CRASHSTATS_API_TOKEN for multiple workers. The output is a lot leaner and easier to read.

Fixes #106.

This reworks the output for fetch-data so each line clearly specifies
which crash id it's related to. Further, it removes a lot of the
coloring. It also removes start/end indicators. The end result is a lot
less output where all the important information is in the line and it
can be read left-to-right and sorted and make sense.

While doing this, I adjusted fetch-data to use "crash_id" instead of
both "crashid" and "crash_id".
This adds a `--workers` option that lets you specify the number of
workers to use for downloading crash data in parallel. This vastly
speeds up downloading.
@@ -232,38 +248,42 @@ def fetch_data(
+ "information.[/yellow]"
)

if workers > 1 and not api_token:
Copy link
Collaborator Author

@willkg willkg Oct 27, 2023

Choose a reason for hiding this comment

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

We should validate workers to be a number between 1 and 10 and print the number of workers being used.

@willkg willkg merged commit ff28620 into main Oct 27, 2023
5 checks passed
@willkg willkg deleted the 106-parallel branch October 27, 2023 20:02
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.

change fetch-data to parallelize downloads
1 participant