All Documents
Current Document

Content is empty

If you don't find the content you expect, please try another search term

Documentation

GetRealTimeHitRateData

Last updated:2021-07-20 11:46:09

GetRealTimeHitRateData

Description

  • You can call this operation to obtain the real-time traffic hit ratio and request hit ratio for specified domain names. You can generate a hit ratio pie chart based on the data.
  • You can query data within the past year. The start time and the end time cannot be more than 90 days apart.
  • You can specify multiple domain names at a time.
  • Timeliness: You can query only data that was generated 5 minutes before.

Request syntax

The API request contains the specified directory /2020-06-30/statistics/GetRealTimeHitRateData, common request headers, and operation-specific request parameters. For more information, see the sample request.

Request parameters

Parameter Required Type Description
StartTime Yes String The beginning of the time range to query. Specify the time in the ISO 8601 standard in the YYYY-MM-DDThh:mm+0800 format. The time must be in UTC+8. Example: 2016-08-01T21:10+0800.
EndTime Yes String The end of the time range to query. Specify the time in the ISO 8601 standard in the YYYY-MM-DDThh:mm+0800 format. The time must be in UTC+8. The end time must be later than the start time. Example: 2016-08-01T21:15+0800.
HitRatetype No String The type of the hit ratio. Valid values: flowhitrate (traffic hit ratio) and reqhitrate (request hit ratio). You can specify only one type at a time. Default value: flowhitrate.
CdnType Yes String The business type. You can specify only one type at a time. Valid values: file, video, and page. When both the CdnType and Domains parameters are specified, a strong check is performed.
Domains No String The domain names to query. Separate multiple domain names with commas (,). By default, all domain names of the current account that are online in the specified time period are queried. When both the CdnType and Domains parameters are specified, a strong check is performed.
ResultType No String Specifies whether to expand the statistics data. Valid values: unexpand and domain (expand by domain name). Default value: unexpand.

Response parameters

Parameter Type Description
StartTime String The beginning of the time range that is queried.
EndTime String The end of the time range that is queried.
HitRatetype String The type of the hit ratio.
CdnType String The business type.
Domains String The domain names, separated with commas (,).
ResultType String Indicates whether the statistics data is expanded and, if yes, in which dimensions.
Datas Datas[] The statistics data.
RequestId String The ID of the request.

Datas

Parameter Type Description
Condition Condition[] The query conditions.
DetailData DetailData The hit ratio.

Condition

Parameter Type Description
Domains String The domain names, separated with commas (,).

DetailData

Parameter Type Description
HitPv Long The number of requests that hit the cache, which is calculated as follows: Service requests - Back-to-origin requests.
MissPv Long The number of requests that missed the cache, which is the number of back-to-origin requests.
HitPvProportion Double The proportion of requests that hit the cache, which is calculated as follows: HitPv/(HitPv+SrcPv). Unit: percentage.
MissPvProportion Double The proportion of requests that missed the cache, which is calculated as follows: SrcPv/(HitPv+SrcPv). Unit: percentage.
HitFlow Long The traffic that hit the cache, which is calculated as follows: Service traffic - Back-to-origin traffic.
MissFlow Long The traffic that missed the cache, which is the back-to-origin traffic.
HitFlowProportion Double The proportion of traffic that hit the cache, which is calculated as follows: HitFlow/(HitFlow + MissFlow). Unit: percentage.
MissFlowProportion Double The proportion of traffic that missed the cache, which is calculated as follows: MissFlow/(HitFlow + MissFlow). Unit: percentage.

Examples

Sample request

GET method:

GET /2020-06-30/statistics/GetRealTimeHitRateData?StartTime=2020-09-01T08%3a00%2b0800&EndTime=2020-09-01T08%3a05%2b0800&HitRatetype=flowhitrate&CdnType=video&ResultType=
Host: cdn.api.ksyun.com
X-Amz-Date: date
Authorization:authorization string
x-action: GetRealTimeHitRateData
x-version: 2020-06-30

POST method:

POST /2020-06-30/statistics/GetRealTimeHitRateData
Host: cdn.api.ksyun.com
X-Amz-Date: date
Authorization:authorization string
x-action: GetRealTimeHitRateData
x-version: 2020-06-30
Content-Type: application/json
{
    "StartTime":"2020-09-01T08:00+0800",
    "EndTime":"2020-09-01T08:05+0800",
    "HitRatetype":"flowhitrate",
    "CdnType":"video",
    "ResultType":""
}

Sample response

{
    "StartTime": "2020-09-01T08:00+0800",
    "EndTime": "2020-09-01T08:05+0800",
    "HitRatetype": "flowhitrate",
    "CdnType": "video",
    "Domains": "www.test.com",
    "ResultType": "unexpand",
    "RequestId": "bb26fc61-3a1b-48fd-be86-aef8f0f27319",
    "Datas": [
        {
            "Condition": {},
            "DetailData": {
                "HitFlow": 270767,
                "MissFlow": 15236,
                "MissFlowProportion": 0.05327211259450502,
                "HitFlowProportion": 0.946726838466549
            }
        }
    ]
}
On this page
Pure ModeNormal Mode

Pure Mode

Click to preview the document content in full screen
Feedback