Handling Tenant Resource Utilization Data

 

Applies To: Windows Azure Pack

The Usage Service REST API provides access to tenant resource utilization data through the Retrieve Usage Data for Tenant Resources REST call. The data is returned in an array of UsageRecord (Usage Metering Object) objects mapping to the provider that the data is from. The provider specific data is stored in the Resources property as a dictionary of name value pairs.

Getting Tenant Resource Utilization Data

The Usage Service REST API exposes resource utilization data via a call to the Retrieve Usage Data for Tenant Resources REST operation. For example:

https://<Computer>:30022/usage?startId=0&batchSize=1 HTTP/1.1
Accept: application/json
Authorization: basic <Token>
Host: <Computer>:30022
Connection: Keep-Alive

Note

  • startId is the record id of the first record you want to fetch in a particular cycle.

  • batchSize is the maximum number of records you want to fetch.

  • <computer> is the Admin API computer name.

  • 30022 is the port designated for the Usage Service.

The response body returns a list of UsageRecord (Usage Metering Object) objects. For example:

[
  {
    "EventId": 1,
    "ExternalRecordId": "1",
    "ResourceId": null,
    "StartTime": "2013-07-31T17:15:49",
    "EndTime": "2013-07-31T17:17:42",
    "ProviderName": "mysqlservers",
    "ServiceType": "Default",
    "SubscriptionId": "a7319215-d5f8-483e-813c-44119bc4ca79",
    "Properties": null,
    "Resources": {
      "TotalAllottedSpace": "1024",
      "DatabaseCount": "1"
    }
  }
]

Function GetAllUsageRecords in the RestApiConsumer.cs file in the ContosoHelp sample demonstrates how to retrieve usage data.

Processing Tenant Resource Utilization Data

A billing Adaptor needs to process usage data from four providers; Websites, SQL Server, MySQL Server, and the System Center Virtual Machine Clouds.

Note

Virtual machine usage metrics are aggregated at a per hour granularity.

Website Provider

Measure

Unit

Description

TotalIncomingRequestBytes

MB

Inbound ingress network traffic between service and clients

TotalIncomingRequestResponseBytes

MB

Inbound engress network traffic between service and clients

TotalLocalReadBytes

MB

Application disk reads

TotalLocalWrittenBytes

MB

Application disk writes

TotalNetworkReadBytes

MB

Inbound total (ingress and egress) network traffic between service and clients

TotalNetworkWrittenBytes

MB

Outbound total (ingress and egress) network traffic between service and clients

TotalOutgoingRequestBytes

MB

Outbound ingress network traffic between service and clients

TotalOutgoingRequestResponseBytes

MB

Outbound engress network traffic between service and clients

TotalProcessorTime

Hours

Application processor utilization

TotalRequestCount

Each

Total web requests

TotalStopRequestsCount

Each

Number of times application has stopped

MaxMemoryWorkingSet

Bytes

Maximum memory working set

MinMemoryWorkingSet

Bytes

Minimum memory working set

TotalMemoryWorkingSet

Bytes

Total memory working set

TotalIncomingFtpRequestBytes

Bytes

Incoming bandwidth for FTP publishing

TotalIncomingFtpRequestResponseBytes

Bytes

Outgoing bandwidth for FTP publishing

TotalFtpCommandsCount

Count

Number of FTP commands issued

TotalIncomingWebDeployRequestBytes

Bytes

Incoming bandwidth for WebDeploy publishing

TotalIncomingWebDeployRequestResponseBytes

Bytes

outgoing bandwidth for webdeploy publishing

TotalWebDeployRequestsCount

Counts

Number of FTP commands issued

HostNamesUsage

Count * Hours Used

“Host Name” hours

NumberOfWorkers

Count * Hours Used

“Worker” hours

SslIpUsage

Count * Hours Used

“IP SSL” hours

SslSniUsage

Count * Hours Used

“SNI SSL” hours

WebSocketsUsage

Count * Hours Used

WebSockets feature enabled hours

Webspace

Name

Webspace name for the web site (used to correlate usage across sites)

ComputeMode

Mode

Compute Mode of the site

SiteMode

Mode

Site mode of the site

SQL Server Provider

Measure

Unit

Description

DatabaseCount

Each

Count of databases currently active against a particular subscription.

TotalAllottedSpace

MB

Total Allocated Space across all the active databases of a particular subscription.

MySQL Provider

Measure

Unit

Description

DatabaseCount

Each

Count of databases currently active against a particular subscription.

TotalAllottedSpace

MB

Total Allocated Space across all the active databases of a particular subscription.

Virtual Machines Provider

Measure

Unit

Description

MemoryAllocated-Min

MB

Lowest allocated memory size for a VM within an hour timespan

MemoryAllocated-Max

MB

Highest allocated memory size for a VM within an hour timespan

MemoryConsumed-Min

MB

Lowest consumed memory size for a VM within an hour timespan

MemoryConsumed-Max

MB

Highest consumed memory size for a VM within an hour timespan

MemoryConsumed-Median

MB

Median average consumed memory size for a VM within an hour timespan

CPUAllocationCount-Min

Each

Lowest number of CPU core allocated for a VM within an hour timespan

CPUAllocationCount-Max

Each

Highest number of CPU core allocated for a VM within an hour timespan

CPUPercentUtilization-Median

MHz

Median average in percentage of CPU consumption for a VM within an hour timespan

CrossDiskIOPerSecond-Min

MB

Lowest input/output per second (IOPS) across all attached disk for a VM within an hour timespan

CrossDiskIOPerSecond-Max

MB

Highest input/output per second (IOPS) across all attached disk for a VM within an hour timespan

CrossDiskIOPerSecond-Median

MB

Median average input/output per second (IOPS) across all attached disk for a VM within an hour timespan

CrossDiskSizeAllocated-Min

Bytes

Lowest allocated disk size across all attached disk for a VM within an hour timespan

CrossDiskSizeAllocated-Max

Bytes

Highest allocated disk size across all attached disk for a VM within an hour timespan

PerNICKBSentPerSecond-Min

MB

Lowest bytes sent per second on a network adapter attached to a VM within an hour timespan

PerNICKBSentPerSecond-Max

MB

Highest bytes sent per second on a network adapter attached to a VM within an hour timespan

PerNICKBSentPerSecond-Median

MB

Median average bytes sent per second on a network adapter attached to a VM within an hour timespan

PerNICKBSentPerSecond-Average

MB

Straight average bytes sent per second on a network adapter attached to a VM within an hour timespan

PerNICKBReceivedPerSecond-Min

MB

Lowest bytes received per second on a network adapter attached to a VM within an hour timespan

PerNICKBReceivedPerSecond-Max

MB

Highest bytes received per second on a network adapter attached to a VM within an hour timespan

PerNICKBReceivedPerSecond-Median

MB

Median average bytes received per second on a network adapter attached to a VM within an hour timespan

PerNICKBReceivedPerSecond-Average

MB

Straight average bytes received per second on a network adapter attached to a VM within an hour timespan

Site64BitUsage

Hours

The number of hours the feature was enabled.

Site64BitUsage

Hours

The number of hours the feature was enabled.

NICKBSentTotalIPV4

KB

Total network traffic sent per NIC over IPV4.

NICKBSentTotalIPV6

KB

Total network traffic sent per NIC over IPV6.

NICKBReceivedTotalIPV4

KB

Total network traffic received per NIC over IPV4.

NICKBReceivedTotalIPV6

KB

Total network traffic received per NIC over IPV6.

See Also

Windows Azure Pack Usage Service