Skip to content

Split profile input loading into focused services - #52

Closed
rogeralsing wants to merge 1 commit into
mainfrom
codex/20260320-195750-69bda6bd
Closed

rogeralsing wants to merge 1 commit into
mainfrom
codex/20260320-195750-69bda6bd

Conversation

@rogeralsing

Copy link
Copy Markdown
Contributor

Summary

  • Replaced the monolithic ProfileInputLoader with dedicated types for input classification, load reporting, trace loading, heap loading, input path validation, and memory result shaping.
  • Pulled timestamped artifact naming, runtime provider construction, and tool install hints out of ProfileCollectionRunner so collection orchestration no longer owns those unrelated responsibilities.
  • Updated ProfilerCommandExecutor and ProfilerExecutionRequestFactory to use the new services directly, and replaced the old loader tests with service-focused coverage.

Testing

  • roslynator fix src/ProfileTool/ProfileTool.csproj
  • roslynator fix src/ProfilerCore/Asynkron.Profiler.Core.csproj
  • roslynator fix tests/Asynkron.Profiler.Tests/Asynkron.Profiler.Tests.csproj
  • dotnet build Asynkron.Profiler.sln -warnaserror
  • dotnet test Asynkron.Profiler.sln --no-build
  • quickdup -path . -ext .cs -select 0..20 -min 2 -exclude ".g.,.generated.,obj,bin"
  • dotnet format Asynkron.Profiler.sln --verify-no-changes

Result

  • Build succeeds with 0 warnings.
  • Test suite passes: 46/46.
  • QuickDup reports 0 duplicate patterns.

Copilot AI review requested due to automatic review settings March 20, 2026 20:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and ProfileLoadReporter to 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants