universal
Query minute-level request cache hit ratios for a specified period. Provide start time, end time, and domain to get data. Granularity options are 1 minute, 5 minutes, 1 hour, or 1 day. It returns cache hit ratios for each minute, helping evaluate domain cache performance on the CDN.
Single user trigger frequency: 300/5min
| Name | Description |
|---|---|
*dateFromString | From date:
1.The time format is yyyy-MM-ddTHH:mm:ss±HH:mm. Please note: ±HH:mm is the time zone offset, which can be adjusted according to your data needs, for example, +00:00 represents UTC time, +08:00 represents East 8th District, and -05:00 represents West 5th District. 2024-01-15T10:30:45+00:00 means UTC time January 15, 2024 10:30:45 AM
2.Cannot exceed current time
3.The most recent six-month (183 days) data are available. |
*dateToString | To time:
1.The time format is yyyy-MM-ddTHH:mm:ss±HH:mm. Please note: ±HH:mm is the time zone offset, which can be adjusted according to your data needs, for example, +00:00 represents UTC time, +08:00 represents East 8th District, and -05:00 represents West 5th District. 2024-01-15T10:30:45+00:00 means UTC time January 15, 2024 10:30:45 AM
2.The end time needs to be greater than the start time. If the end time is greater than the current time, take the current time.
3.Date from, Date to both, the default query past 24 hours; If there is only one unsent, throw an exception
4.Maximum allowed query time interval: 31 days, Date from and dateTo, not more than 31 days |
*domainList | Domain:
1.The maximum number of deliverable domain names is 200 by default
2.Automatically filter out illegal domain names (pass illegal domain names, will be filtered out, the query results only return the data of legitimate domain names)
3.The default query accounts for all domains if the number of domain names exceeds the upper limit when the entry is not delivered. If the number of domain names in the account exceeds the limit, an error is raised. |
*dataIntervalString | Data granularity:
1m: 1 minute granularity.
5m: 5 minute granularity.
1h: 1 hour granularity.
1d: 1 day granularity. Default value is 1d. |
| Name | Description |
|---|---|
codeString | request result status code |
messageString | Request result information |
dataList | Detailed data on the results of the request |
realDateString | Actually processed time. yyyy-MM-dd HH:mm format |
totalAvgObject | Average of total hit ratio. |
hitRatioDatasList | hitRatioDatas |
timestampString | timetamp
1. When the data granularity of the query is fiveminutes, the format is yyyy-MM-dd HH:MM; Each time slice data value represents the data value in the previous time granularity range, For example yyyy-MM-dd 00:05 represents data in the range from 00:00 to 00:05.
2.The data granularity of query is hourly, the format is yyyy-MM-dd HH. Each time slice data value represents data values in the previous time granularity range such as yyyy-MM-dd 01 that represent data from 00 to 01.
3. the data granularity of the query is daily, the format is yyyy-MM-dd; Each time slice data value represents the data value for that day.
4.Returns the timetamp contained in start time and end time. |
hitRatioString | Cache hit ratio,keep 4 decimal places |
| Error code(code) | Description(message) | HTTP status | Semantic |
|---|---|---|---|
| 24102013 | Accept request header not supported, interface only supports json and xml format, default to json format | 400 | Accept request header not supported, interface only supports json and xml format, default to json format |
| 24102020 | Request Head Time Zone Illegal | 400 | Request Head Time Zone Illegal |
| 24102002 | Request physical error | 400 | Request physical error |
| 24102006 | Date from or dateTo does not conform to specifications or is not legal in a time interval | 400 | Date from or dateTo does not conform to specifications or is not legal in a time interval |
| 24102007 | Date from and dateTo exceed the limit | 400 | Date from and dateTo exceed the limit |
| 24102019 | Number of domain names passed exceeds account limit | 400 | Number of domain names passed exceeds account limit |
| 24102008 | Parameter domain does not conform to specification | 400 | Parameter domain does not conform to specification |
| 24102008 | Parameter dataInterval does not conform to specification | 400 | Parameter dataInterval does not conform to specification |
| 24102500 | System error occurred | 500 | System error occurred |
#!/bin/bash
# Please remember to change the param (-H "X-Time-Zone") in this demo to the TimeZone you want in response
username='example_username'
apiKey='example_apiKey'
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url "https://api.atomile.com/api/report/request/hit-ratio/total" \
-X "POST" \
-H "X-Time-Zone:GMT+00:00" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-d '{
"dateFrom": "2019-09-17T00:00:00+00:00",
"dateTo": "2019-09-17T23:00:00+00:00",
"domain": ["www.aaa.com","www.bbb.com"],
"dataInterval": "1h"
}'{
"code": "0",
"message": "success",
"data": [
{
"realDate": "2019-09-17 15:17",
"totalAvg": "0.33",
"hitRatioDatas": [
{
"timestamp": "2019-09-17 00",
"hitRatio": "0.6000"
},
{
"timestamp": "2019-09-17 01",
"hitRatio": "0.2000"
},
{
"timestamp": "2019-09-17 02",
"hitRatio": "0.2000"
}
]
}
]
}