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
F13905507: D19152.id45883.diff
Mon, Oct 7, 9:10 PM
F13905505: D19152.id45877.diff
Mon, Oct 7, 9:10 PM
F13905504: D19152.id.diff
Mon, Oct 7, 9:10 PM
Unknown Object (File)
Sat, Oct 5, 9:49 PM
Unknown Object (File)
Thu, Oct 3, 10:35 AM
Unknown Object (File)
Sat, Sep 21, 9:59 AM
Unknown Object (File)
Fri, Sep 20, 11:05 PM
Unknown Object (File)
Fri, Sep 13, 3:21 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