Refactor LogFileReader for better testing and fix PluginRegistry initialization#571
Open
Hirogen wants to merge 25 commits intoDevelopmentfrom
Open
Refactor LogFileReader for better testing and fix PluginRegistry initialization#571Hirogen wants to merge 25 commits intoDevelopmentfrom
Hirogen wants to merge 25 commits intoDevelopmentfrom
Conversation
added different progress reporter
…xperts/LogExpert into refactorings_logfile_reader
…xperts/LogExpert into refactorings_logfile_reader
…xperts/LogExpert into refactorings_logfile_reader
added 2 commits
April 30, 2026 08:53
…using the ILogfileReader interface for real
…xperts/LogExpert into refactorings_logfile_reader
Comment on lines
+6543
to
+6549
| catch (NullReferenceException ex) | ||
| { | ||
| #if DEBUG | ||
| _logger.Warn(ex, "Failed to get cell value due to null state. rowIndex={RowIndex}, columnIndex={ColumnIndex}", rowIndex, columnIndex); | ||
| #endif | ||
| return Column.EmptyColumn; | ||
| } |
| : Column.EmptyColumn; | ||
| } | ||
| } | ||
| catch (IndexOutOfRangeException ex) |
| #endif | ||
| return Column.EmptyColumn; | ||
| } | ||
| catch (ArgumentOutOfRangeException ex) |
| #endif | ||
| return Column.EmptyColumn; | ||
| } | ||
| catch (NullReferenceException ex) |
| } | ||
| } | ||
| catch | ||
| catch (IndexOutOfRangeException ex) |
| #endif | ||
| return Column.EmptyColumn; | ||
| } | ||
| catch (ArgumentOutOfRangeException ex) |
| #endif | ||
| return Column.EmptyColumn; | ||
| } | ||
| catch (NullReferenceException ex) |
| break; | ||
| } | ||
| var filePos = logBuffer.StartPos; | ||
| reader.Position = logBuffer.StartPos; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces benchmark infrastructure and supporting utilities for the
BufferIndexclass, along with a new immutable snapshot type and related unit tests. The main goal is to enable performance testing and validation of buffer management logic, especially for large log files, and to provide a safe, inspectable snapshot of buffer state for both tests and diagnostics. Several test and namespace organization improvements are included as well.Benchmarking and diagnostics infrastructure:
BufferIndexBenchmarksclass using BenchmarkDotNet to measure performance of various buffer access patterns (sequential, stride, boundary, scrolling, and LRU eviction) for theBufferIndexclass. (src/LogExpert.Benchmarks/BufferIndexBenchmarks.cs)FakeLogFileInfostub to support in-memory benchmarking without filesystem access. (src/LogExpert.Benchmarks/Support/FakeLogFileInfo.cs)BufferIndexSnapshotimmutable class to capture the state ofBufferIndexsafely for inspection, including a record type for buffer metadata. (src/LogExpert.Core/Classes/Log/BufferIndexSnapshot.cs)Unit tests and test refactoring:
BufferIndexSnapshot, verifying summary formatting, record equality, and default values. (src/LogExpert.Tests/Buffers/BufferIndexSnapshotTests.cs)BufferShiftTestto use the new snapshot interface, improving test clarity and reliability. Also moved the test to theBuffersnamespace for better organization. (src/LogExpert.Tests/Buffers/BufferShiftTest.cs) [1] [2] [3]src/LogExpert.Tests/Services/FileOperationServiceTests.cs,src/LogExpert.Tests/Services/TabControllerTests.cs) [1] [2] [3] [4] [5]Benchmark entry point and cleanup:
Programentry point for benchmarks, with instructions for running different benchmark jobs and ensuring performance regressions are caught. (src/LogExpert.Benchmarks/Program.cs)StreamReaderBenchmarks.csto avoid duplicateMainmethods. (src/LogExpert.Benchmarks/StreamReaderBenchmarks.cs) [1] [2]These changes lay the groundwork for robust performance testing and diagnostics of buffer management, making it easier to ensure high performance and correctness as the codebase evolves.