Refactor LogFileReader for better testing and fix PluginRegistry initialization#571
Open
Hirogen wants to merge 16 commits intoDevelopmentfrom
Open
Refactor LogFileReader for better testing and fix PluginRegistry initialization#571Hirogen wants to merge 16 commits intoDevelopmentfrom
Hirogen wants to merge 16 commits intoDevelopmentfrom
Conversation
added different progress reporter
…xperts/LogExpert into refactorings_logfile_reader
|
|
||
| private LineSegment? _currentSegment; | ||
| private PipeReader _pipeReader; | ||
| private CancellationTokenSource _cts; |
…xperts/LogExpert into refactorings_logfile_reader
|
|
||
| var fakeFileInfo = new FakeLogFileInfo(); | ||
|
|
||
| using (var writeLock = _index.AcquireWriteLock()) |
Comment on lines
+333
to
+334
| { | ||
| } |
Comment on lines
+348
to
+349
| { | ||
| } |
| var retrieved2 = buffer.GetLineMemoryOfBlock(1); | ||
| Assert.That(retrieved1.HasValue, Is.True); | ||
| Assert.That(retrieved2.HasValue, Is.True); | ||
| Assert.That(retrieved1.Value.FullLine.Span.ToString(), Is.EqualTo("Hello World")); |
| Assert.That(retrieved1.HasValue, Is.True); | ||
| Assert.That(retrieved2.HasValue, Is.True); | ||
| Assert.That(retrieved1.Value.FullLine.Span.ToString(), Is.EqualTo("Hello World")); | ||
| Assert.That(retrieved2.Value.FullLine.Span.ToString(), Is.EqualTo("Second Line")); |
…xperts/LogExpert into refactorings_logfile_reader
| return; | ||
| } | ||
|
|
||
| ILogStreamReaderMemory reader = null; |
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.