SALES: 1-800-867-1380
This topic has not yet been rated - Rate this topic

Get Current Usage Metrics for a Site

Updated: January 15, 2014

You can retrieve a site's current usage metrics by issuing an HTTP GET request. The metrics returned include CPU Time, Data In, Data Out, Local bytes read, Local bytes written, Network bytes read, Network bytes written, WP stop requests, Memory Usage, CPU Time - Minute Limit, and File System Storage.

Request

Replace <Subscription-ID>, <WebSpaceName>, and <SiteName> with the corresponding values for your web site.

 

Method Request URI HTTP Version

GET

https://management.core.windows.net/<Subscription-Id>/services/WebSpaces/<WebSpaceName>/sites/<SiteName>/usages

HTTP/1.1

URI Parameters

None.

Request Headers

The following table describes required and optional request headers.

 

Request Header Description

x-ms-version

Optional. Specifies the version of the operation to use for this request. If you do not specify a version, the latest version is used. For more information about versioning headers, see API Versioning on the Web Sites Management REST API Reference page.

accept: application/json

Optional. Use this header to receive the response in JSON format.

Request Body

None.

Response

The response includes an HTTP status code, a set of response headers, and a response body.

Status Code

A successful operation returns status code 200 (OK).

For information about status codes, see Service Management Status and Error Codes.

Response Headers

The response for this operation includes the following headers. The response may also include additional standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.

 

Response Header Description

x-ms-request-id

A value that uniquely identifies the request made against the Management service.

Response Body

The response body a series of Usage elements that contain information for each metric.

The following is an example JSON response body for the 2012-10-10 version.


[{
    "ComputeMode": 0,
    "CurrentValue": 0,
    "DisplayName": "CPU Time",
    "Limit": -1,
    "Name": "CpuTime",
    "NextResetTime": "\/Date(1365897600000+0000)\/",
    "ResourceName": "CpuTime",
    "SiteMode": "Limited",
    "Unit": "Milliseconds"
},
{
    "ComputeMode": 0,
    "CurrentValue": 0,
    "DisplayName": "Data In",
    "Limit": -1,
    "Name": "BytesReceived",
    "NextResetTime": "\/Date(1365897600000+0000)\/",
    "ResourceName": "BytesReceived",
    "SiteMode": "Limited",
    "Unit": "Bytes"
},
{
    "ComputeMode": 0,
    "CurrentValue": 0,
    "DisplayName": "Data Out",
    "Limit": -1,
    "Name": "BytesSent",
    "NextResetTime": "\/Date(1365897600000+0000)\/",
    "ResourceName": "BytesSent",
    "SiteMode": "Limited",
    "Unit": "Bytes"
},
{
    "ComputeMode": 0,
    "CurrentValue": 0,
    "DisplayName": "Local bytes read",
    "Limit": -1,
    "Name": "LocalBytesRead",
    "NextResetTime": "\/Date(1365897600000+0000)\/",
    "ResourceName": "LocalBytesRead",
    "SiteMode": "Limited",
    "Unit": "Bytes"
},
{
    "ComputeMode": 0,
    "CurrentValue": 0,
    "DisplayName": "Local bytes written",
    "Limit": -1,
    "Name": "LocalBytesWritten",
    "NextResetTime": "\/Date(1365897600000+0000)\/",
    "ResourceName": "LocalBytesWritten",
    "SiteMode": "Limited",
    "Unit": "Bytes"
},
{
    "ComputeMode": 0,
    "CurrentValue": 0,
    "DisplayName": "Network bytes read",
    "Limit": -1,
    "Name": "NetworkBytesRead",
    "NextResetTime": "\/Date(1365897600000+0000)\/",
    "ResourceName": "NetworkBytesRead",
    "SiteMode": "Limited",
    "Unit": "Bytes"
},
{
    "ComputeMode": 0,
    "CurrentValue": 0,
    "DisplayName": "Network bytes written",
    "Limit": -1,
    "Name": "NetworkBytesWritten",
    "NextResetTime": "\/Date(1365897600000+0000)\/",
    "ResourceName": "NetworkBytesWritten",
    "SiteMode": "Limited",
    "Unit": "Bytes"
},
{
    "ComputeMode": 0,
    "CurrentValue": 0,
    "DisplayName": "WP stop requests",
    "Limit": -1,
    "Name": "WPStopRequests",
    "NextResetTime": "\/Date(1365814800000+0000)\/",
    "ResourceName": "WPStopRequests",
    "SiteMode": "Limited",
    "Unit": "Count"
},
{
    "ComputeMode": 0,
    "CurrentValue": 0,
    "DisplayName": "Memory Usage",
    "Limit": -1,
    "Name": "MaxMemoryWorkingSetShortPeriod",
    "NextResetTime": "\/Date(1365814800000+0000)\/",
    "ResourceName": "MaxMemoryWorkingSet",
    "SiteMode": "Limited",
    "Unit": "Bytes"
},
{
    "ComputeMode": 0,
    "CurrentValue": 0,
    "DisplayName": "CPU Time - Minute Limit",
    "Limit": -1,
    "Name": "CpuTimeShortPeriod",
    "NextResetTime": "\/Date(1365811500000+0000)\/",
    "ResourceName": "CpuTime",
    "SiteMode": "Limited",
    "Unit": "Milliseconds"
},
{
    "ComputeMode": 0,
    "CurrentValue": 982016,
    "DisplayName": "File System Storage",
    "Limit": 10737418240,
    "Name": "FileSystemStorage",
    "NextResetTime": "\/Date(253402300799999)\/",
    "ResourceName": "FileSystemStorage",
    "SiteMode": "Limited",
    "Unit": "Bytes"
}]


The following is an example XML response body for the 2012-10-10 version.


<Usages xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <Usage>
    <ComputeMode>Shared</ComputeMode>
    <CurrentValue>0</CurrentValue>
    <DisplayName>CPU Time</DisplayName>
    <Limit>-1</Limit>
    <Name>CpuTime</Name>
    <NextResetTime>2013-04-13T00:00:00</NextResetTime>
    <ResourceName>CpuTime</ResourceName>
    <SiteMode>Limited</SiteMode>
    <Unit>Milliseconds</Unit>
  </Usage>
  <Usage>
    <ComputeMode>Shared</ComputeMode>
    <CurrentValue>0</CurrentValue>
    <DisplayName>Data In</DisplayName>
    <Limit>-1</Limit>
    <Name>BytesReceived</Name>
    <NextResetTime>2013-04-13T00:00:00</NextResetTime>
    <ResourceName>BytesReceived</ResourceName>
    <SiteMode>Limited</SiteMode>
    <Unit>Bytes</Unit>
  </Usage>
  <Usage>
    <ComputeMode>Shared</ComputeMode>
    <CurrentValue>0</CurrentValue>
    <DisplayName>Data Out</DisplayName>
    <Limit>-1</Limit>
    <Name>BytesSent</Name>
    <NextResetTime>2013-04-13T00:00:00</NextResetTime>
    <ResourceName>BytesSent</ResourceName>
    <SiteMode>Limited</SiteMode>
    <Unit>Bytes</Unit>
  </Usage>
  <Usage>
    <ComputeMode>Shared</ComputeMode>
    <CurrentValue>0</CurrentValue>
    <DisplayName>Local bytes read</DisplayName>
    <Limit>-1</Limit>
    <Name>LocalBytesRead</Name>
    <NextResetTime>2013-04-13T00:00:00</NextResetTime>
    <ResourceName>LocalBytesRead</ResourceName>
    <SiteMode>Limited</SiteMode>
    <Unit>Bytes</Unit>
  </Usage>
  <Usage>
    <ComputeMode>Shared</ComputeMode>
    <CurrentValue>0</CurrentValue>
    <DisplayName>Local bytes written</DisplayName>
    <Limit>-1</Limit>
    <Name>LocalBytesWritten</Name>
    <NextResetTime>2013-04-13T00:00:00</NextResetTime>
    <ResourceName>LocalBytesWritten</ResourceName>
    <SiteMode>Limited</SiteMode>
    <Unit>Bytes</Unit>
  </Usage>
  <Usage>
    <ComputeMode>Shared</ComputeMode>
    <CurrentValue>0</CurrentValue>
    <DisplayName>Network bytes read</DisplayName>
    <Limit>-1</Limit>
    <Name>NetworkBytesRead</Name>
    <NextResetTime>2013-04-13T00:00:00</NextResetTime>
    <ResourceName>NetworkBytesRead</ResourceName>
    <SiteMode>Limited</SiteMode>
    <Unit>Bytes</Unit>
  </Usage>
  <Usage>
    <ComputeMode>Shared</ComputeMode>
    <CurrentValue>0</CurrentValue>
    <DisplayName>Network bytes written</DisplayName>
    <Limit>-1</Limit>
    <Name>NetworkBytesWritten</Name>
    <NextResetTime>2013-04-13T00:00:00</NextResetTime>
    <ResourceName>NetworkBytesWritten</ResourceName>
    <SiteMode>Limited</SiteMode>
    <Unit>Bytes</Unit>
  </Usage>
  <Usage>
    <ComputeMode>Shared</ComputeMode>
    <CurrentValue>0</CurrentValue>
    <DisplayName>WP stop requests</DisplayName>
    <Limit>-1</Limit>
    <Name>WPStopRequests</Name>
    <NextResetTime>2013-04-13T00:00:00</NextResetTime>
    <ResourceName>WPStopRequests</ResourceName>
    <SiteMode>Limited</SiteMode>
    <Unit>Count</Unit>
  </Usage>
  <Usage>
    <ComputeMode>Shared</ComputeMode>
    <CurrentValue>0</CurrentValue>
    <DisplayName>Memory Usage</DisplayName>
    <Limit>-1</Limit>
    <Name>MaxMemoryWorkingSetShortPeriod</Name>
    <NextResetTime>2013-04-13T00:00:00</NextResetTime>
    <ResourceName>MaxMemoryWorkingSet</ResourceName>
    <SiteMode>Limited</SiteMode>
    <Unit>Bytes</Unit>
  </Usage>
  <Usage>
    <ComputeMode>Shared</ComputeMode>
    <CurrentValue>0</CurrentValue>
    <DisplayName>CPU Time - Minute Limit</DisplayName>
    <Limit>-1</Limit>
    <Name>CpuTimeShortPeriod</Name>
    <NextResetTime>2013-04-13T00:03:00</NextResetTime>
    <ResourceName>CpuTime</ResourceName>
    <SiteMode>Limited</SiteMode>
    <Unit>Milliseconds</Unit>
  </Usage>
  <Usage>
    <ComputeMode>Shared</ComputeMode>
    <CurrentValue>982016</CurrentValue>
    <DisplayName>File System Storage</DisplayName>
    <Limit>10737418240</Limit>
    <Name>FileSystemStorage</Name>
    <NextResetTime>9999-12-31T23:59:59.9999999Z</NextResetTime>
    <ResourceName>FileSystemStorage</ResourceName>
    <SiteMode>Limited</SiteMode>
    <Unit>Bytes</Unit>
  </Usage>
</Usages>

Key Elements

The following table describes the members of the elements in the response body.

 

Element Name Description

Usages

Container element for a set of metrics.

Usages.Usage

Container element for a specific metric.

Usages.Usage.ComputeMode

The compute mode of the web site. For web sites in Standard Mode, the return value is Dedicated. For web sites in Free or Shared mode, the return value is Shared.

Usages.Usage.CurrentValue

The current value of the metric specified, expressed in terms of the measurement specified by the Unit element.

Usages.Usage.DisplayName

The display name of the metric (includes spaces).

Usages.Usage.Limit

The maximum point that the given metric can reach. The limit resets at the time specified by the NextResetTime element. If the limit is reached before the reset time, the site will be stopped. A value of -1 means unlimited. Resources with limits typically include CPU Time, Memory Usage, and File System Storage.

ImportantImportant
Site level Limits information is only meaningful for Shared and Standard web sites. For free web sites, limits are enforced at the webspace level.

Usages.Usage.Name

The name of the metric, without spaces. The value is usually the same as that of the ResourceName element.

Usages.Usage.NextResetTime

The time at which the metric will be reset.

Usages.Usage.ResourceName

The name of the resource being measured.

Usages.Usage.SiteMode

The scaling for the web site. Web sites in Free Mode return a value of Limited. Web sites in Shared Mode return a value of Basic. Sites in Standard Mode return null.

Usages.Usage.Unit

The unit of measure for the given metric.

Authorization

Any management certificate associated with the subscription specified by <Subscription-Id> can be used to authenticate this operation. For additional details, see Authenticating Service Management Requests.

See Also

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.