Queries the statistics of a specified metric for a specified site monitoring task.

This topic provides an example on how to query the statistics of the Availability metric for a site monitoring task whose ID is ef4cdc8b-9dc7-43e7-810e-f950e56c****. The result indicates that the availability rate of the site is 100%.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeSiteMonitorStatistics

The operation that you want to perform. Set the value to DescribeSiteMonitorStatistics.

TaskId String Yes ef4cdc8b-9dc7-43e7-810e-f950e56c****

The ID of the site monitoring task.

For more information about how to obtain the ID of a site monitoring task, see DescribeSiteMonitorList.

TimeRange String No 1440

The statistical period.

Unit: minutes. Default value: 1440 (1 day). Maximum value: 43200 (30 days).

StartTime String No 1576142850527

The beginning of the time range to query.

Unit: milliseconds. The default value is 1 hour ahead of the current time.

MetricName String Yes Availability

The metric name. Valid values:

  • Availability
  • ErrorRate
  • ResponseTime

For more information about common request parameters, see Common parameters.

Response parameters

Parameter Type Example Description
Code String 200

The status code.

Note The status code 200 indicates that the request was successful.
Message String Successful

The returned message.

Data String 100

The statistics.

RequestId String 3AD2724D-E317-4BFB-B422-D6691D071BE1

The request ID.

Success String true

Indicates whether the request was successful. Valid values:

  • true
  • false

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeSiteMonitorStatistics
&MetricName=Availability
&TaskId=ef4cdc8b-9dc7-43e7-810e-f950e56c****
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeSiteMonitorStatisticsResponse>
	<Message>successful</Message>
	<RequestId>3AD2724D-E317-4BFB-B422-D6691D071BE1</RequestId>
	<Data>100</Data>
	<Code>200</Code>
	<Success>true</Success>
</DescribeSiteMonitorStatisticsResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Message" : "successful",
  "RequestId" : "3AD2724D-E317-4BFB-B422-D6691D071BE1",
  "Data" : 100,
  "Code" : "200",
  "Success" : true
}

Error codes

For a list of error codes, see Service error codes.