Skip to content

Improve performance#57

Merged
arktronic-sep merged 3 commits into
mainfrom
improve-perf
Jun 13, 2026
Merged

Improve performance#57
arktronic-sep merged 3 commits into
mainfrom
improve-perf

Conversation

@arktronic-sep

Copy link
Copy Markdown
Collaborator

No description provided.

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 improves read/query performance for check status displays by denormalizing the “latest check result” fields onto the Checks table and updating query paths to use those columns instead of querying/sorting CheckResults.

Changes:

  • Add denormalized latest-result columns to Checks (migration + entity/config updates) and backfill them from existing CheckResults.
  • Update WorkspaceQueryService and CheckQueryService list queries to read Latest* columns rather than computing latest results via CheckResults.
  • Update CheckExecutorJob to maintain the denormalized columns and extend integration tests to validate the behavior.

Reviewed changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
SAMA.Web/Services/Queries/WorkspaceQueryService.cs Uses Check.LatestStatus/LatestCheckedAt for workspace status counts instead of querying CheckResults.
SAMA.Web/Services/Queries/CheckQueryService.cs Projects Latest* columns directly into list view models, removing the extra “latest results” query.
SAMA.Web/Services/CheckExecutorJob.cs Updates Check.Latest* columns when persisting a new CheckResult.
SAMA.Web/SAMA.Web.csproj Bumps several runtime dependencies (Quartz, EF health checks, MailKit, etc.).
SAMA.Tests.Unit/SAMA.Tests.Unit.csproj Updates test tooling packages (coverlet, MSTest).
SAMA.Tests.System/SAMA.Tests.System.csproj Updates MSTest package version.
SAMA.Tests.Integration/Web/Services/Queries/WorkspaceQueryServiceTests.cs Updates test helper to maintain Check.Latest* while inserting CheckResults.
SAMA.Tests.Integration/Web/Services/Queries/CheckQueryServiceTests.cs Updates test helper to maintain Check.Latest* while inserting CheckResults.
SAMA.Tests.Integration/Web/Services/CheckExecutorJobIntegrationTests.cs Adds coverage to ensure CheckExecutorJob updates denormalized columns.
SAMA.Tests.Integration/SAMA.Tests.Integration.csproj Bumps EF/Npgsql/MSTest + coverage tool versions for integration tests.
SAMA.Shared/SAMA.Shared.csproj Bumps Microsoft.Extensions.Http package version.
SAMA.Data/SAMA.Data.csproj Bumps EF/Npgsql/Identity EF package versions.
SAMA.Data/Migrations/SamaDbContextModelSnapshot.cs Reflects the new Check.Latest* columns in the model snapshot.
SAMA.Data/Migrations/20260612212029_AddLatestResultDenormalizationToChecks.Designer.cs New migration designer including Check.Latest* columns.
SAMA.Data/Migrations/20260612212029_AddLatestResultDenormalizationToChecks.cs Adds columns + backfills them from CheckResults via SQL.
SAMA.Data/Entities/Check.cs Adds LatestStatus, LatestCheckedAt, LatestResponseTimeMs, LatestErrorMessage properties.
SAMA.Data/Configuration/CheckConfiguration.cs Configures max lengths for the new denormalized columns.
Files not reviewed (1)
  • SAMA.Data/Migrations/20260612212029_AddLatestResultDenormalizationToChecks.Designer.cs: Generated file

Comment thread SAMA.Web/Services/CheckExecutorJob.cs Outdated
Comment on lines +29 to +33
public string? LatestStatus { get; set; }

public DateTimeOffset? LatestCheckedAt { get; set; }

public int? LatestResponseTimeMs { get; set; }
Comment on lines +22 to +24
modelBuilder
.HasAnnotation("ProductVersion", "10.0.5")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
Comment thread SAMA.Data/Migrations/20260612212029_AddLatestResultDenormalizationToChecks.cs Outdated
@arktronic-sep
arktronic-sep merged commit ccdeb1f into main Jun 13, 2026
4 checks passed
@arktronic-sep
arktronic-sep deleted the improve-perf branch June 13, 2026 21:40
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