Page MenuHomePhabricator

Add a "--rate" flag to `bin/harbormaster write-log` to support testing live log streaming
ClosedPublic

Authored by epriestley on Feb 28 2018, 3:45 PM.
Tags
None
Referenced Files
F14076075: D19152.diff
Thu, Nov 21, 2:37 PM
Unknown Object (File)
Sat, Nov 16, 11:33 PM
Unknown Object (File)
Thu, Nov 14, 4:04 AM
Unknown Object (File)
Mon, Nov 4, 6:52 PM
Unknown Object (File)
Sun, Oct 27, 4:08 AM
Unknown Object (File)
Oct 22 2024, 5:27 PM
Unknown Object (File)
Oct 7 2024, 9:10 PM
Unknown Object (File)
Oct 7 2024, 9:10 PM
Subscribers
Restricted Owners Package

Details

Summary

Depends on D19151. Ref T13088. While dramatically less exciting than using lolcat and less general than pv, this should do the job adequately.

Test Plan

Piped a sizable log into bin/harbormaster write-log with --rate 2048, saw a progress bar. Loaded the log in the web UI and saw it grow as the page reloaded.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Owners added a subscriber: Restricted Owners Package.Feb 28 2018, 3:46 PM

Doesn't "lines" make more sense as the unit you measure the import rate at, or no?

99% of the time, yes, but it isn't very good for testing Harbormaster's behavior when you pipe a lot of of binary garbage with no newlines inside it (e.g., head -c99999999 /dev/zero | ...), or pipe in half a UTF8 character at a time so that the log continually ends in the middle of an emoji or something like that. I only expect this flag to be useful for testing/development and want it to be able to test those cases, and a byte-based rate can surface those better than a line-based rate.

This revision is now accepted and ready to land.Feb 28 2018, 5:49 PM