Commit Graph

47 Commits (a27198e8ca8cf38ad36de07ba96583a00cfead11)

Author SHA1 Message Date
Timothy Stack a27198e8ca [regex101] add an integration with regex101
... and a pile of other changes
2 years ago
Timothy Stack 0785a432fa [console] colorize console output 2 years ago
Timothy Stack 81e63784e7 [modernize] some more cleanups 2 years ago
Timothy Stack 66ef5fdae1 [clang-format] init 2 years ago
Timothy Stack e593bde875 [build] fix some issues on xenial32 3 years ago
Timothy Stack f5e88b7158 [docs] add ARCHITECTURE.md and various other things 3 years ago
Phil Hord f10a303f54 Revert "Don't try to read concatenated gzip streams"
This reverts commit 1d127053e9.
4 years ago
Timothy Stack 51d1204a96 [arc] add content hash to archive temp dir and tech debt 4 years ago
Timothy Stack db8a3c4d38 [debt] doing some cleanup
Defect Number:
    Reviewed By:
   Testing Done:
4 years ago
Phil Hord 1d127053e9 Don't try to read concatenated gzip streams
Don't try to continue reading the next stream of a concatenated
gzip file.  The next stream may be CRC noise or other garbage.

Maybe in the future we should look for a gzip header in the
following bytes of the stream and try to decode from there.
But it's not clear that anyone ever uses this supposed gzip
feature anyway.

Let's just end the stream when we reach EOS. Also, if the
stream fails to init, let's leave it closed instead of throwing
an error no one is likely to catch.  Log the error msg from
zlib if one is provided.
4 years ago
Timothy Stack ce0383dee1 [build] fix some warnings 4 years ago
Timothy Stack 0940e97b2b [nits] fix some naming issues
Fixes #169
4 years ago
Timothy Stack 138a506b1a [perf] a few performance tweaks 4 years ago
Phil Hord 5513deeade Add a gzip indexing class for faster gz navigation
The gzread function is slow.  Every time you seek to a new location, the
whole file up to that position has to be decompressed again.  This causes
massive lags when trying to do simple things in lnav on a large .gz file.

Use the zlib inflate* functions instead and record the dictionary
periodically while processing the file the first time.  Then use
inflateSetDictionary to restore the dictionary to a convenient
location when trying to seek into the file again in the future.

Use a default period of 1MB of compressed data for syncpoints.
Each syncpoint uses 32KB. This is a ratio of 3.2%.  For example,
a 1GB .gz file (compressed size) will require us to keep 32MB
of index data in memory. A better method may be to use a fixed
number of syncpoints and divide the file appropriately. This
would keep the memory bounded at the cost of slower file
navigation on large .gz files.

Use pread to read the data for the stream decompressor and remove
the lock_hack previously employed.

NB. The documentation on these zlib functions is sparse. I followed
the example in zlib/examples/zran.c, but I used the z_stream total_in
and total_out variables instead of keeping my own separately as zran.c
does.  Maybe this is incompatible with some very old zlib versions.
I haven't looked.
5 years ago
Timothy Stack 02c53976b4 Some refactoring for the line buffer and other cleanups
Fixes #649
5 years ago
Timothy Stack fb7d6eafaf [build] some refactoring of files 5 years ago
Timothy Stack 66ef968529 [logfile] fix a performance bug in searching json logs 6 years ago
Timothy Stack 2589345e5c [perf] improve initial indexing times 6 years ago
Phil Hord 5a20829ed4 dynamic exception specifications are deprecated in C++11
Remove exception specifications to appease modern compilers and reduce
warning counts.

I sort of hate to remove all these exception-decls, but they are in fact
deprecated, and my compiler loves to complain.
6 years ago
Timothy Stack 88a192aeeb [line_buffer] if the size of the file is known, reduce the requested buffer size and ignore attempts to shrink the buffer 6 years ago
Timothy Stack 34d1422b76 [highlight] only highlight keywords in text files
Fixes #408
7 years ago
Timothy Stack 99eb3a54f3 [spectro] support marking lines in a bucket 8 years ago
Timothy Stack e8f400abfa [logfile] truncation detection was not taking into account compressed files 8 years ago
Timothy Stack 6e196bff79 [line_buffer] clear cached data when doing a read 9 years ago
Timothy Stack b6e10f4ee4 bump the max line size to try and solve some json log issues 9 years ago
Timothy Stack 25a375f08d [misc] fix various bugs 9 years ago
Timothy Stack 5a7c5a2139 [piper] the piper was not exiting if the stream it was reading did not terminate with a line feed 9 years ago
Timothy Stack cfa628f6c4 various fixes
Defect Number:
    Reviewed By:
   Testing Done:
10 years ago
Timothy Stack a71ca1f1ca [filter] some improvements to the core filtering code 10 years ago
Timothy Stack 9ff2d3774d [line_buffer] split long lines
Fixes #81
10 years ago
Timothy Stack b6baae7730 [debug] more debugging stuff
Defect Number:
    Reviewed By:
   Testing Done:
10 years ago
Timothy Stack 601c19a537 [scrollbar] change the look of the scrollbar 10 years ago
Timothy Stack 6a38619ac7 [piper] fix for partial lines when reading stdin 10 years ago
Timothy Stack 5ef8a168a7 [perf] reduce copies of log messages 11 years ago
Timothy Stack 2d33cb7f7e [log format] some more log format work 11 years ago
Timothy Stack 865849f017 [spam] uncrustify pass 11 years ago
Timothy Stack f62b5c271c [release] bump to 0.5.1 11 years ago
Timothy Stack a92785e889 [piper_proc] add timestamp and file write options for stdin 11 years ago
Timothy Stack d4f170e747 cppcheck fixes 11 years ago
Timothy Stack c4e9f58bf0 [bugs] fix some long-standing bugs
* grep_proc.cc: When a request is queued with the start line
   == -1, we need to start searching from the highest line
   ever seen and not the last line processed.
 * line_buffer.cc: If a partial line was read, we need to
   avoid returning another line if more data is appended
   to the file.
 * lnav.cc: Accept file name patterns on the command-line that
   don't match any files yet.  Initialize the screen before
   redirecting stderr to the log file or /dev/null.
 * log_format.hh: Add some comments.  Start to add back support
   for scrubbing.
 * logfile_sub_source.cc: Move scrubbing to the format impl.
 * textview_curses.hh: Add comments.
12 years ago
Timothy Stack b68a1bba9b [test] some cleanup for tests and other things
Just a cleanup pass
12 years ago
Timothy Stack ee1e2afd53 [win build] Fix some problems with building on cygwin
The cygwin build is pretty straightforward, but there's
still some glitches that need to be fixed.

 * line_buffer.hh, line_buffer.cc: If the bzip library is not available, don't
   try to open bzip files.  Also, ignore ENODATA errors since they seem to
   show up when pread reaches the end of the file.
 * lnav.cc: The abs() function is ambiguous on windows, use std::abs instead.
12 years ago
Tim Stack 7a6d9c83f2 cleanup and bug fixes 13 years ago
Timothy Stack 456e015fb0 Add support for bzip2; fix some performance bugs; and
display the log file type in the top status bar.
13 years ago
Timothy Stack c268760e2e Hopefully fix a bug when progressively reading from a file and
add some comments.
14 years ago
Timothy Stack 3f6212766a Fix for line buffers growing too large 15 years ago
tstack b4ec432515 first commit 15 years ago