Split profile input loading into focused services - #52
Closed
rogeralsing wants to merge 1 commit into
Closed
rogeralsing wants to merge 1 commit into
rogeralsing wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors profile-input loading and profile collection orchestration by replacing the former monolithic ProfileInputLoader with smaller, focused services and factories, and wiring those services into the execution/collection flow in ProfileTool.
Changes:
- Introduces
ProfileInputCatalog,TraceProfileInputService,HeapProfileInputService, andProfileLoadReporterto split responsibilities around input classification, validation, loading, and reporting. - Extracts artifact naming, runtime provider string construction, and tool install hints into dedicated helpers (
ProfileArtifactPathFactory,DotnetRuntimeProviderFactory,ProfilerToolInstallHints). - Updates command execution and request creation to use the new services; replaces loader-focused tests with service-focused coverage.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Asynkron.Profiler.Tests/ProfileInputServicesTests.cs | Updates tests to target the new catalog/services and factories. |
| src/ProfileTool/TraceProfileInputService.cs | New service for CPU/memory/exception/contention trace loading and analysis with shared reporting. |
| src/ProfileTool/HeapProfileInputService.cs | New service for heap input handling (gcdump/text/log) and collected gcdump post-processing. |
| src/ProfileTool/ProfileInputCatalog.cs | Centralizes input kind detection, default mode selection, and label building. |
| src/ProfileTool/ProfileInputPathValidator.cs | Extracted file-existence validation helper for input paths. |
| src/ProfileTool/ProfileLoadReporter.cs | Extracted reporting helper for consistent error/parse reporting output. |
| src/ProfileTool/MemoryProfileResultFactory.cs | Extracted factory for shaping MemoryProfileResult from allocation call trees. |
| src/ProfileTool/ProfileArtifactPathFactory.cs | Extracted helper for timestamped artifact path naming. |
| src/ProfileTool/DotnetRuntimeProviderFactory.cs | Extracted helper for dotnet runtime provider strings (exception/contention). |
| src/ProfileTool/ProfilerToolInstallHints.cs | Centralizes install-hint strings for external dotnet tools. |
| src/ProfileTool/ProfileCollectionRunner.cs | Rewires collection runner to use the new services/factories and extracted helpers. |
| src/ProfileTool/ProfilerCommandExecutor.cs | Constructs and uses the new services instead of the old loader. |
| src/ProfileTool/ProfilerExecutionRequestFactory.cs | Uses ProfileInputCatalog for label building and default mode selection. |
| src/ProfileTool/ProfileInputLoader.cs | Removes the previous monolithic loader implementation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
ProfileInputLoaderwith dedicated types for input classification, load reporting, trace loading, heap loading, input path validation, and memory result shaping.ProfileCollectionRunnerso collection orchestration no longer owns those unrelated responsibilities.ProfilerCommandExecutorandProfilerExecutionRequestFactoryto use the new services directly, and replaced the old loader tests with service-focused coverage.Testing
roslynator fix src/ProfileTool/ProfileTool.csprojroslynator fix src/ProfilerCore/Asynkron.Profiler.Core.csprojroslynator fix tests/Asynkron.Profiler.Tests/Asynkron.Profiler.Tests.csprojdotnet build Asynkron.Profiler.sln -warnaserrordotnet test Asynkron.Profiler.sln --no-buildquickdup -path . -ext .cs -select 0..20 -min 2 -exclude ".g.,.generated.,obj,bin"dotnet format Asynkron.Profiler.sln --verify-no-changesResult