也許下面的查詢可以爲您提供更深入的瞭解:
SELECT (COUNT(END_TIME) - SUM(CASE WHEN avg_cpu_percent> 80 THEN (COUNT(end_time) - SUM(CASE WHEN avg_log_write_percent> 80 THEN 1 ELSE 0 END)* 1.0)/ COUNT(end_time)AS'CPU適用百分比'日誌寫適合百分比' ,(COUNT(end_time) - SUM(CASE W HEN avg_data_io_percent> 80 THEN ELSE 1 0 END)* 1.0)/ COUNT(END_TIME)AS '物理數據讀擬合百分比' FROM sys.dm_db_resource_stats
--service水平目標的99.9%<(SLO)=去下一層
- 使用sys.dm_db_resource_stats DMV
的表現最後時刻 - 使用電流DB
SELECT DISTINCT
MIN(end_time) AS StartTime
,MAX(end_time) AS EndTime
,CAST(AVG(avg_cpu_percent) AS decimal(4,2)) AS Avg_CPU
,MAX(avg_cpu_percent) AS Max_CPU
,CAST(AVG(avg_data_io_percent) AS decimal(4,2)) AS Avg_IO
,MAX(avg_data_io_percent) AS Max_IO
,CAST(AVG(avg_log_write_percent) AS decimal(4,2)) AS Avg_LogWrite
,MAX(avg_log_write_percent) AS Max_LogWrite
,CAST(AVG(avg_memory_usage_percent) AS decimal(4,2)) AS Avg_Memory
,MAX(avg_memory_usage_percent) AS Max_Memory
FROM sys.dm_db_resource_stats
希望這有助於。
問候,
阿爾貝託·莫里略
SQLCoffee.com
感謝回答阿爾貝託。似乎DTU是Azure數據庫的度量標準。但是,我們仍然可以通過查詢sys.dm_db_resource_stats來獲取CPU/Mem的百分比。 REST API還提供CPU百分比。我只是想知道我們是否可以得到任何其他CPU/Mem相關指標,例如CPU/Mem容量/利用率/使用率? – Jerry