Skip to content

Commit

Permalink
Merge pull request #579 from bcgov/yj
Browse files Browse the repository at this point in the history
chore: metrics for the aggr listings
  • Loading branch information
ychung-mot authored Aug 29, 2024
2 parents b1b9828 + ed1e7dc commit bdc3e7a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions server/StrDss.Data/Repositories/RentalListingRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using StrDss.Model;
using StrDss.Model.DelistingDtos;
using StrDss.Model.RentalReportDtos;
using System.Diagnostics;

namespace StrDss.Data.Repositories
{
Expand Down Expand Up @@ -95,8 +96,16 @@ public async Task<PagedDto<RentalListingGroupDto>> GetGroupedRentalListings(stri

var extraSort = "";

var stopwatch = Stopwatch.StartNew();

var groupedListings = await Page<RentalListingGroupDto, RentalListingGroupDto>(groupedQuery, pageSize, pageNumber, orderBy, direction, extraSort);

stopwatch.Stop();

_logger.LogInformation($"Get Grouped Listings (group) - Page Size: {pageSize}, Page Number: {pageNumber}, Time: {stopwatch.Elapsed.TotalSeconds} seconds");

stopwatch.Restart();

foreach (var group in groupedListings.SourceList)
{
group.Listings
Expand All @@ -105,6 +114,10 @@ public async Task<PagedDto<RentalListingGroupDto>> GetGroupedRentalListings(stri
hostName, businessLicence, prRequirement, blRequirement, lgId, statusArray, reassigned, takedownComplete, group);
}

_logger.LogInformation($"Get Grouped Listings (listings) - Page Size: {pageSize}, Page Number: {pageNumber}, Time: {stopwatch.Elapsed.TotalSeconds} seconds");

stopwatch.Stop();

return groupedListings;
}

Expand Down

0 comments on commit bdc3e7a

Please sign in to comment.