Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions Dashboard/Services/DatabaseService.ResourceMetrics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,15 @@ public async Task<List<MemoryDataPoint>> GetMemoryDataAsync(int hoursBack = 24,
ms.total_memory_mb,
granted_memory_mb = ISNULL(
(
SELECT
SELECT TOP (1)
SUM(mgs.granted_memory_mb)
FROM collect.memory_grant_stats AS mgs
WHERE mgs.collection_time = ms.collection_time
WHERE mgs.collection_time >= DATEADD(MINUTE, -5, ms.collection_time)
AND mgs.collection_time <= DATEADD(MINUTE, 5, ms.collection_time)
GROUP BY
mgs.collection_time
ORDER BY
ABS(DATEDIFF(SECOND, mgs.collection_time, ms.collection_time)) ASC
), 0)
FROM collect.memory_stats AS ms
WHERE ms.collection_time >= @from_date
Expand All @@ -337,10 +342,15 @@ ORDER BY
ms.total_memory_mb,
granted_memory_mb = ISNULL(
(
SELECT
SELECT TOP (1)
SUM(mgs.granted_memory_mb)
FROM collect.memory_grant_stats AS mgs
WHERE mgs.collection_time = ms.collection_time
WHERE mgs.collection_time >= DATEADD(MINUTE, -5, ms.collection_time)
AND mgs.collection_time <= DATEADD(MINUTE, 5, ms.collection_time)
GROUP BY
mgs.collection_time
ORDER BY
ABS(DATEDIFF(SECOND, mgs.collection_time, ms.collection_time)) ASC
), 0)
FROM collect.memory_stats AS ms
WHERE ms.collection_time >= DATEADD(HOUR, @hours_back, SYSDATETIME())
Expand Down
Loading