google / mtail

extract internal monitoring data from application logs for collection in a timeseries database
Apache License 2.0
3.82k stars 378 forks source link

fix: Correctly handle lines that cross buffer boundaries. #902

Closed jaqx0r closed 1 month ago

jaqx0r commented 1 month ago

FileStream had been fixed a while back but we still had this problem for the other LogStream implementations.

This new code extracts the common read handling and manages the read buffer between calls.

It regresses in the handling of rune errors by choosing to do nothing to them instead of converting them. It is also faster in half the BenchmarkProgram benchmarks as a result of not caring to decode the runes. The other half... are they slower because the decoder has been fixed to not skip bytes?

Issue: #637

github-actions[bot] commented 1 month ago

Unit Test Results

    1 files     27 suites   8m 51s :stopwatch:   669 tests   667 :white_check_mark: 2 :zzz: 0 :x: 1 980 runs  1 974 :white_check_mark: 6 :zzz: 0 :x:

Results for commit b35d7394.

:recycle: This comment has been updated with latest results.