Skip to content

Commit

Permalink
chore: metrics for the aggr listings
Browse files Browse the repository at this point in the history
  • Loading branch information
ychung-mot committed Aug 29, 2024
1 parent a4fbf08 commit ed1e7dc
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 ed1e7dc

Please sign in to comment.