Skip to content

Commit 041ba9b

Browse files
authored
Merge pull request #669 from bcgov/yj
chore: grouped listing debug
2 parents 5f2c6ce + 0e59c98 commit 041ba9b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

server/StrDss.Data/Repositories/RentalListingRepository.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ var extraSort
8585
public async Task<PagedDto<RentalListingGroupDto>> GetGroupedRentalListings(string? all, string? address, string? url, string? listingId, string? hostName, string? businessLicence,
8686
bool? prRequirement, bool? blRequirement, long? lgId, string[] statusArray, bool? reassigned, bool? takedownComplete, int pageSize, int pageNumber, string orderBy, string direction)
8787
{
88+
var stopwatch = Stopwatch.StartNew();
89+
8890
var query = _dbSet.AsNoTracking();
8991

9092
if (_currentUser.OrganizationType == OrganizationTypes.LG)
@@ -106,13 +108,9 @@ public async Task<PagedDto<RentalListingGroupDto>> GetGroupedRentalListings(stri
106108

107109
var extraSort = "";
108110

109-
var stopwatch = Stopwatch.StartNew();
110111

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

113-
stopwatch.Stop();
114-
115-
_logger.LogDebug($"Get Grouped Listings (group) - Page Size: {pageSize}, Page Number: {pageNumber}, Time: {stopwatch.Elapsed.TotalSeconds} seconds");
116114

117115
foreach (var group in groupedListings.SourceList)
118116
{
@@ -122,6 +120,10 @@ public async Task<PagedDto<RentalListingGroupDto>> GetGroupedRentalListings(stri
122120
hostName, businessLicence, prRequirement, blRequirement, lgId, statusArray, reassigned, takedownComplete, group);
123121
}
124122

123+
stopwatch.Stop();
124+
125+
_logger.LogDebug($"Get Grouped Listings (group) - Page Size: {pageSize}, Page Number: {pageNumber}, Total Time: {stopwatch.Elapsed.TotalSeconds} seconds");
126+
125127
return groupedListings;
126128
}
127129

0 commit comments

Comments
 (0)