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
Unknown Object (File)
Thu, Apr 11, 9:36 AM
Unknown Object (File)
Sat, Mar 30, 6:05 AM
Unknown Object (File)
Sat, Mar 23, 5:43 PM
Unknown Object (File)
Thu, Mar 21, 12:30 PM
Unknown Object (File)
Wed, Mar 20, 11:23 AM
Unknown Object (File)
Wed, Mar 20, 3:35 AM
Unknown Object (File)
Tue, Mar 19, 3:23 PM
Unknown Object (File)
Tue, Mar 19, 3:22 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