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

feat(progress-logger): added a progress logger #10

Merged
merged 1 commit into from
Aug 6, 2022

Conversation

sstadick
Copy link
Contributor

@sstadick sstadick commented Aug 5, 2022

This PR adds a simple progress logger into the hot loop to "greps" the reads to track how many reads have been searched so far. With it's existing configuration it emits ~ 1 log message every 30 seconds.

Example logging output of a full run:

[2022-08-05T18:03:56Z INFO  fqgrep] Creating reader threads
[2022-08-05T18:03:56Z INFO  fqgrep] Processing reads
[2022-08-05T18:04:27Z INFO  proglog] [fqgrep-progress] Searched 50000000 reads
[2022-08-05T18:04:57Z INFO  proglog] [fqgrep-progress] Searched 100000000 reads
[2022-08-05T18:05:28Z INFO  proglog] [fqgrep-progress] Searched 150000000 reads
[2022-08-05T18:05:58Z INFO  proglog] [fqgrep-progress] Searched 200000000 reads
[2022-08-05T18:06:28Z INFO  proglog] [fqgrep-progress] Searched 250000000 reads
[2022-08-05T18:06:58Z INFO  proglog] [fqgrep-progress] Searched 300000000 reads
[2022-08-05T18:07:29Z INFO  proglog] [fqgrep-progress] Searched 350000000 reads
[2022-08-05T18:07:59Z INFO  proglog] [fqgrep-progress] Searched 400000000 reads
[2022-08-05T18:08:29Z INFO  proglog] [fqgrep-progress] Searched 450000000 reads
[2022-08-05T18:08:59Z INFO  proglog] [fqgrep-progress] Searched 500000000 reads
[2022-08-05T18:09:30Z INFO  proglog] [fqgrep-progress] Searched 550000000 reads
[2022-08-05T18:10:00Z INFO  proglog] [fqgrep-progress] Searched 600000000 reads
[2022-08-05T18:10:30Z INFO  proglog] [fqgrep-progress] Searched 650000000 reads
[2022-08-05T18:11:01Z INFO  proglog] [fqgrep-progress] Searched 700000000 reads
[2022-08-05T18:11:31Z INFO  proglog] [fqgrep-progress] Searched 750000000 reads
[2022-08-05T18:12:01Z INFO  proglog] [fqgrep-progress] Searched 800000000 reads
[2022-08-05T18:12:30Z INFO  proglog] [fqgrep-progress] Searched 850000000 reads
[2022-08-05T18:13:01Z INFO  proglog] [fqgrep-progress] Searched 900000000 reads
[2022-08-05T18:13:31Z INFO  proglog] [fqgrep-progress] Searched 950000000 reads
[2022-08-05T18:14:01Z INFO  proglog] [fqgrep-progress] Searched 1000000000 reads
[2022-08-05T18:14:32Z INFO  proglog] [fqgrep-progress] Searched 1050000000 reads
[2022-08-05T18:15:02Z INFO  proglog] [fqgrep-progress] Searched 1100000000 reads
[2022-08-05T18:15:32Z INFO  proglog] [fqgrep-progress] Searched 1150000000 reads
[2022-08-05T18:16:02Z INFO  proglog] [fqgrep-progress] Searched 1200000000 reads
[2022-08-05T18:16:33Z INFO  proglog] [fqgrep-progress] Searched 1250000000 reads
[2022-08-05T18:17:03Z INFO  proglog] [fqgrep-progress] Searched 1300000000 reads
[2022-08-05T18:17:33Z INFO  proglog] [fqgrep-progress] Searched 1350000000 reads
[2022-08-05T18:17:54Z INFO  fqgrep] Joining reader threads
[2022-08-05T18:17:54Z INFO  fqgrep] Joining writer threads and collecting stats
[2022-08-05T18:17:54Z INFO  proglog] [fqgrep-progress] Searched 1384167117 reads
[2022-08-05T18:17:54Z INFO  fqgrep] 52820 reads matched input ref sequence
[2022-08-05T18:17:54Z INFO  fqgrep] 98740 reads matched input alt sequence
[2022-08-05T18:17:54Z INFO  fqgrep] 7 reads matched both input ref and alt sequences
[2022-08-05T18:17:54Z INFO  fqgrep] Writing stats

With some crude CLI benchmarking on both fqgrep and other projects proglog does not slow down hot loops to any appreciable degree as long as unit size is set high enough.

@sstadick sstadick mentioned this pull request Aug 5, 2022
Copy link
Member

@nh13 nh13 left a comment

Choose a reason for hiding this comment

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

One minor suggestion

.name("fqgrep-progress")
.noun("reads")
.verb("Searched")
.unit(50_000_000)
Copy link
Member

Choose a reason for hiding this comment

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

Shall we separate with comma's (there's a crate for that)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure! I'll put it behind a feature flag I think to keep proglog low dependency by default, but agree tidier numbers would be nice.

Copy link
Member

Choose a reason for hiding this comment

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

I am not going to hold this PR up, thank-you @sstadick !

@nh13 nh13 merged commit 531b1be into main Aug 6, 2022
@nh13 nh13 deleted the feature/progress_logging branch August 6, 2022 20:29
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