Share via


Retrieve the Metrics for a Plan

 

Applies To: Windows Azure Pack

Retrieves the plan metrics from the supplied start date to the supplied end date.

Request

Specify the Get Plan Metrics request as follows: Replace <ServiceMgmt> with your Service Management API endpoint address. <PlanIdentifier> should be replaced with the plan identifier for the plan being retrieved.

Method

Request URI

HTTP version

GET

https://<ServiceMgmt>:30004/plans/<PlanIdentifier>

HTTP/1.1

URI Parameters

This request has the following URI parameters.

URI parameter

Description

startTime

Required. The DateTime to start metric gathering from.

endTime

Required. The DateTime to end metric gathering.

Request Headers

The following table describes required and optional request headers.

Request header

Description

Authorization: Bearer

Required. The authorization bearer token.

x-ms-principal-id

Required. The principal identifier.

x-ms-client-request-id

Optional. The client request identifier.

x-ms-client-session-id

Optional. The client session identifier.

x-ms-principal-liveid

Optional. The principal Live identifier.

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). If the URI parameters are incorrect, this request returns 404.

For information about status codes, see Status and Error Codes (Windows Azure Pack Service Management).

Response Headers

The response contains standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.

Response Body

The following table describes the elements of the request body.

Element name

Description

Name

The metric name. Possible values include DailySignupCount or TotalSignupCount.

PrimaryAggregationType

The metric primary aggregation type. Values include Total.

Unit

The metric unit. Possible values are:

  • Bytes

  • BytesPerSec

  • Count

  • Megabytes

  • Milliseconds

  • Other

  • Percentage

  • Seconds

TimeGrain

The metric time grain.

StartTime

The start time for the returned set of metric values.

EndTime

The end time for the returned set of metric values.

Values

A list of metric values. In the case of the Count aggregation type, the following format is used:

Element name

Description

Time Created

The DateTime the metric value was recorded.

Total

DailySignUp - The total number of daily sign ups recorded.TotalSignUp - The total number of sign ups.

Minimum

The minimum value.

Maximum

The maximum value.

Count

The value count.

Example

The following code example shows a Get Plan Metrics request.

GET https://<Computer>:30004/plans/Svclvfrkussi3occcwh/metrics?startTime=2013-06-22T07%3a00%3a00.0000000Z&endTime=2013-06-29T07%3a00%3a00.0000000Z HTTP/1.1
Authorization: Bearer <Token>
x-ms-client-request-id: 3f9565a5-bdf6-41ac-a61e-d2de886f95df-2013-06-28 18:13:40Z
x-ms-client-session-id: d19ca528-d7bf-4a62-9d4d-03adbb4f6c74
x-ms-principal-id: <COMPUTER>\Administrator
Accept-Language: en-US
x-ms-principal-liveid: <COMPUTER>\Administrator
Host: <Computer>:30004

The following code example shows a Get Plan Metrics response.

[
  {
    "Name": "DailySignupCount",
    "PrimaryAggregationType": "Total",
    "Unit": "Count",
    "TimeGrain": "1.00:00:00",
    "StartTime": "2013-06-22T07:00:00Z",
    "EndTime": "2013-06-29T07:00:00Z",
    "Values": [
      {
        "TimeCreated": "2013-06-22T07:00:00Z",
        "Total": 0,
        "Minimum": null,
        "Maximum": null,
        "Count": 1
      }
    ]
  },
  {
    "Name": "TotalSignupCount",
    "PrimaryAggregationType": "Total",
    "Unit": "Count",
    "TimeGrain": "1.00:00:00",
    "StartTime": "2013-06-22T07:00:00Z",
    "EndTime": "2013-06-29T07:00:00Z",
    "Values": [
      {
        "TimeCreated": "2013-06-22T07:00:00Z",
        "Total": 0,
        "Minimum": null,
        "Maximum": null,
        "Count": 1
      },
      {
        "TimeCreated": "2013-06-28T07:00:00Z",
        "Total": 0,
        "Minimum": null,
        "Maximum": null,
        "Count": 1
      }
    ]
  }
]

See Also

Administrator Plan Interfaces