-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathazure 15sec dtu usage.sql
More file actions
36 lines (31 loc) · 1.37 KB
/
azure 15sec dtu usage.sql
File metadata and controls
36 lines (31 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
--https://msdn.microsoft.com/en-us/library/dn800981.aspx
--Run in the user Azure database
SELECT SYSDATETIMEOFFSET()
GO
SELECT
Database_Name = DB_NAME()
, TierDTU = rs.dtu_limit
, 'Average CPU Utilization In %' = AVG(rs.avg_cpu_percent)
, 'Maximum CPU Utilization In %' = MAX(rs.avg_cpu_percent)
, 'Average Data IO In %' = AVG(rs.avg_data_io_percent)
, 'Maximum Data IO In %' = MAX(rs.avg_data_io_percent)
, 'Average Log Write Utilization In %' = AVG(rs.avg_log_write_percent)
, 'Maximum Log Write Utilization In %' = MAX(rs.avg_log_write_percent)
, 'Average Memory Usage In %' = AVG(rs.avg_memory_usage_percent)
, 'Maximum Memory Usage In %' = MAX(rs.avg_memory_usage_percent)
FROM sys.dm_db_resource_stats as rs --past hour only
group by rs.dtu_limit
GO
select
Database_Name = DB_NAME()
, UTC_time = end_time
, 'CPU Utilization In % of Limit' = rs.avg_cpu_percent
, 'Data IO In % of Limit' = rs.avg_data_io_percent
, 'Log Write Utilization In % of Limit' = rs.avg_log_write_percent
, 'Memory Usage In % of Limit' = rs.avg_memory_usage_percent
, 'In-Memory OLTP Storage in % of Limit' = rs.xtp_storage_percent
, 'Concurrent Worker Threads in % of Limit' = rs.max_worker_percent
, 'Concurrent Sessions in % of Limit' = rs.max_session_percent
from
sys.dm_db_resource_stats as rs --past hour only
order by rs.end_time desc