Table of Contents

Class AzureSQLDatabaseSchema.ResourceStat

Namespace
LinqToDB.Tools.DataProvider.SqlServer.Schemas
Assembly
linq2db.Tools.dll

sys.resource_stats (Azure SQL Database)

Applies to: √ Azure SQL Database

Returns CPU usage and storage data for an Azure SQL Database. The data is collected and aggregated within five-minute intervals. For each user database, there is one row for every five-minute reporting window in which there is a change in resource consumption. The data returned includes CPU usage, storage size change, and database SKU modification. Idle databases with no changes may not have rows for every five-minute interval. Historical data is retained for approximately 14 days.
The sys.resource_stats view has different definitions depending on the version of the Azure SQL Database Server that the database is associated with. Consider these differences and any modifications your application requires when upgrading to a new server version.

note


This dynamic management view applies to Azure SQL Database only. For an equivalent view for Azure SQL Managed Instance, use sys.server_resource_stats.


The following table describes the columns available in a v12 server:

See sys.resource_stats.

[Table(Schema = "sys", Name = "resource_stats", IsView = true)]
public class AzureSQLDatabaseSchema.ResourceStat
Inheritance
AzureSQLDatabaseSchema.ResourceStat
Extension Methods

Properties

AllocatedStorageInMegaBytes

The amount of formatted file space in MB made available for storing database data. Formatted file space is also referred to as data space allocated. For more information, see: File space management in SQL Database

[Column("allocated_storage_in_megabytes")]
[NotNull]
public double AllocatedStorageInMegaBytes { get; set; }

Property Value

double

AvgCpuPercent

Average compute utilization in percentage of the limit of the service tier.

[Column("avg_cpu_percent")]
[NotNull]
public object AvgCpuPercent { get; set; }

Property Value

object

AvgDataIoPercent

Average I/O utilization in percentage based on the limit of the service tier. For Hyperscale databases, see Data IO in resource utilization statistics.

[Column("avg_data_io_percent")]
[NotNull]
public object AvgDataIoPercent { get; set; }

Property Value

object

AvgInstanceCpuPercent

Average database CPU usage as a percentage of the SQL Database process.

[Column("avg_instance_cpu_percent")]
[NotNull]
public object AvgInstanceCpuPercent { get; set; }

Property Value

object

AvgInstanceMemoryPercent

Average database memory usage as a percentage of the SQL Database process.

[Column("avg_instance_memory_percent")]
[NotNull]
public object AvgInstanceMemoryPercent { get; set; }

Property Value

object

AvgLogWritePercent

Average write resource utilization in percentage of the limit of the service tier.

[Column("avg_log_write_percent")]
[NotNull]
public object AvgLogWritePercent { get; set; }

Property Value

object

AvgLoginRatePercent

Identified for informational purposes only. Not supported. Future compatibility is not guaranteed.

[Column("avg_login_rate_percent")]
[NotNull]
public object AvgLoginRatePercent { get; set; }

Property Value

object

CpuLimit

Number of vCores for this database during this interval. For databases using the DTU-based model, this column is NULL.

[Column("cpu_limit")]
[NotNull]
public object CpuLimit { get; set; }

Property Value

object

DTULimit

Current max database DTU setting for this database during this interval.

[Column("dtu_limit")]
[NotNull]
public int DTULimit { get; set; }

Property Value

int

DatabaseName

Name of the user database.

[Column("database_name")]
[NotNull]
public string DatabaseName { get; set; }

Property Value

string

EndTime

UTC time indicating the end of the five-minute reporting interval.

[Column("end_time")]
[NotNull]
public DateTime EndTime { get; set; }

Property Value

DateTime

MaxSessionPercent

Maximum concurrent sessions in percentage based on the limit of the database's service tier.

Maximum is currently calculated for the five-minute interval based on the 15-second samples of concurrent session counts.

[Column("max_session_percent")]
[NotNull]
public object MaxSessionPercent { get; set; }

Property Value

object

MaxWorkerPercent

Maximum concurrent workers (requests) in percentage based on the limit of the database's service tier.

Maximum is currently calculated for the five-minute interval based on the 15-second samples of concurrent worker counts.

[Column("max_worker_percent")]
[NotNull]
public object MaxWorkerPercent { get; set; }

Property Value

object

Sku

Service Tier of the database. The following are the possible values:

Basic

Standard

Premium

General Purpose

Business Critical

[Column("sku")]
[NotNull]
public string Sku { get; set; }

Property Value

string

StartTime

UTC time indicating the start of the five-minute reporting interval.

[Column("start_time")]
[NotNull]
public DateTime StartTime { get; set; }

Property Value

DateTime

StorageInMegaBytes

Maximum storage size in megabytes for the time period, including database data, indexes, stored procedures, and metadata.

[Column("storage_in_megabytes")]
[NotNull]
public double StorageInMegaBytes { get; set; }

Property Value

double

XtpStoragePercent

Storage utilization for In-Memory OLTP in percentage of the limit of the service tier (at the end of the reporting interval). This includes memory used for storage of the following In-Memory OLTP objects: memory-optimized tables, indexes, and table variables. It also includes memory used for processing ALTER TABLE operations.

Returns 0 if In-Memory OLTP is not used in the database.

[Column("xtp_storage_percent")]
[NotNull]
public object XtpStoragePercent { get; set; }

Property Value

object