0

vm.listExtensions();

according to the following:

com.microsoft.azure.management.compute.virtualMachine

From the Azure resource explorer, I saw SqlDatabase has similar extensions field, but there's no listExtensions() method for SqlDatabase (com.microsoft.azure.management.sql.SqlDatabase). I wonder how can we get the extension for SqlDatabase.

(BTW, my goal is to get the memory metric for Azure SQL Database.)

Any comment or suggestion is appreciated.

2 Answers 2

1

If you go to resources.azure.com, under “SKU” you will find two elements. The name (like RS0) and the tier (like Standard). From those two elements you can deduce the maximum of DTUs for that tier.

Remember that on SQL Azure Database resources available (like RAM and CPU) are expressed in terms of Database Transaction Units (DTUs).

Hope this helps.

Regards, Alberto Morillo

SQLCoffee.com

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for replying Alberto. Seems that DTU is a metric for Azure DB. But still we can get the CPU/Mem percentage by querying sys.dm_db_resource_stats. The REST api also provides CPU percentage. I just wonder if we can get any other CPU/Mem related metrics, such as CPU/Mem capacity/utilization/used?
0

Maybe the following queries can provide you more insight:

SELECT (COUNT(end_time) - SUM(CASE WHEN avg_cpu_percent > 80 THEN 1 ELSE 0 END) * 1.0) / COUNT(end_time) AS 'CPU Fit Percent' ,(COUNT(end_time) - SUM(CASE WHEN avg_log_write_percent > 80 THEN 1 ELSE 0 END) * 1.0) / COUNT(end_time) AS 'Log Write Fit Percent' ,(COUNT(end_time) - SUM(CASE WHEN avg_data_io_percent > 80 THEN 1 ELSE 0 END) * 1.0) / COUNT(end_time) AS 'Physical Data Read Fit Percent' FROM sys.dm_db_resource_stats

--service level objective (SLO) of 99.9% <= go to next tier


-- Last hour of performance using the sys.dm_db_resource_stats DMV

-- Uses current 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

Hope this helps.

Regards,

Alberto Morillo

SQLCoffee.com

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.