Skip to content

Commit 514e071

Browse files
committed
chore: aggr listings log
1 parent 644ac08 commit 514e071

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

server/StrDss.Data/Repositories/RentalListingRepository.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,19 +236,25 @@ await _dbSet.AsNoTracking()
236236

237237
_logger.LogInformation($"Get Grouped Listings (all listings) - Count: {listings.Count}, Time: {stopwatch.Elapsed.TotalSeconds} seconds");
238238

239-
stopwatch.Restart();
240-
241239
group.NightsBookedYtdQty = 0;
242240

243241
foreach (var listing in listings)
244242
{
243+
stopwatch.Restart();
244+
245245
await SetExtraProperties(listing);
246246

247247
listing.Filtered = filteredIdSet.Contains(listing.RentalListingId ?? 0);
248248

249249
group.NightsBookedYtdQty += listing.NightsBookedYtdQty ?? 0;
250+
251+
stopwatch.Stop();
252+
253+
_logger.LogInformation($"Get Grouped Listings (extra properties) - Count: {listings.Count}, Time: {stopwatch.Elapsed.TotalSeconds} seconds");
250254
}
251255

256+
stopwatch.Restart();
257+
252258
var lastActionDtm = listings.Max(x => x.LastActionDtm);
253259

254260
var listingWithLatestAction = listings.FirstOrDefault(x => x.LastActionDtm == lastActionDtm);
@@ -263,7 +269,7 @@ await _dbSet.AsNoTracking()
263269

264270
stopwatch.Stop();
265271

266-
_logger.LogInformation($"Get Grouped Listings (extra properties) - Count: {listings.Count}, Time: {stopwatch.Elapsed.TotalSeconds} seconds");
272+
_logger.LogInformation($"Get Grouped Listings (group header properties) - Time: {stopwatch.Elapsed.TotalSeconds} seconds");
267273

268274
return listings;
269275
}

0 commit comments

Comments
 (0)