查詢整體統計數據
更新時間 2024-09-19 15:19:11
最近更新時間: 2024-09-19 15:19:11
分享文章
接口描述:調用本接口可同時查詢多個統計指標,包含請求數,請求命中率,QPS,流量,命中流量,流量命中率,帶寬
請求方式:post
請求路徑:/statistics/query-summary-data
使用說明:
- 單個用戶一分鐘限制調用10000次,并發不超過100;
- 時間粒度為24h時,查詢開始時間與結束時間需要跨天;
- 若查詢結束時間不包含在該批次的最后一秒,默認end_time為該批次最后一秒,例如:時間粒度為1h,end_time設置為17:30對應的時間戳,此時end_time默認成17:59:59;
- 時間片統計數據均為前打點,假如請求5分鐘粒度數據,time_stamp= "2021-10-13 00:00"對應的時間戳,表示統計的數據為時間區間[2021-10-13 00:00, 2021-10-13 00:05);
- 根據請求參數時間粒度(Interval)的不同,單次請求可查詢歷史數據范圍,數據延遲, 支持最大的時間跨度均不同,對應如下,若開始時間超過可查詢歷史數據時間范圍,超過部分的數據為0:
| 時間粒度 | 可查詢歷史數據時間范圍 | 數據延遲 | 單次可查詢的時間跨度 |
|---|---|---|---|
| 1m | 最近7天 | 5分鐘 | 1小時 |
| 5m | 最近365天 | 20分鐘 | 5小時 |
| 1h | 最近365天 | 20分鐘 | 1天 |
| 24h | 最近365天 | 20分鐘 | 31天 |
請求參數說明
| 參數 | 類型 | 是否必傳 | 名稱 | 描述 |
|---|---|---|---|---|
| start_time | int | 是 | 開始時間戳 | 起始時間,時間戳(秒)。 |
| end_time | int | 是 | 結束時間戳 | 結束時間,時間戳(秒)。 |
| interval | string | 否 | 時間粒度 | 時間粒度,目前支持1m,5m,1h和24h,默認5m。 |
| product_type | string | 是 | 產品類型 | 產品類型,僅支持單個產品類型,支持:“001”(靜態加速),“003”(下載加速),“004”(視頻點播加速),“008”(CDN加速),“014”(下載加速閑時) |
| domain | string | 否 | 域名 | 域名,僅支持單個域名,作為統計篩選項,不傳默認名下所有域名。 |
| province | list | 否 | 省編碼列表 | 省編碼,不傳默認所有省份,可多個省編碼,作為統計篩選項,點擊查看省份及對應的省編碼 |
| isp | list | 否 | 運營商編碼列表 | 運營商編碼,不傳默認所有運營商,可多個運營商編碼,作為統計篩選項,點擊查看運營商及對應的運營商編碼 |
| network_layer_protocol | string | 否 | 網絡層協議 | 網絡層協議,不傳默認所有網絡層協議,支持作為統計篩選項,可以為ipv4、ipv6,other。 |
| application_layer_protocol | string | 否 | 應用層協議 | 應用層協議,不傳默認所有絡層協議,支持作為統計篩選項,可以為http,https,quic,other。 |
| abroad | int | 否 | 區域 | 區域,國內(0),國外(1),不傳或為空默認返回全部區域 |
| group_by | string | 否 | 結果聚合維度 | 指標在計算結果的聚合維度,不傳或為空默認按照時間粒度聚合,傳參增加返回結果的聚合維度,支持busi_type,province,isp,network_layer_protocol,application_layer_protocol,abroad。 |
返回參數說明:
| 參數 | 類型 | 是否必傳 | 名稱及描述 |
|---|---|---|---|
| code | int | 是 | 狀態碼 |
| message | string | 是 | 描述信息 |
| start_time | int | 否 | 開始時間戳,時間戳(秒) |
| end_time | int | 否 | 結束時間戳,時間戳(秒) |
| interval | string | 否 | 時間粒度 |
| req_summary_data_interval | list< object> | 否 | 每個時間間隔的帶寬數據 |
| req_summary_data_interval[*].time_stamp | int | 否 | 時間片開始時間戳 |
| req_summary_data_interval[*].province | int | 否 | 省編碼 |
| req_summary_data_interval[*].isp | string | 否 | 運營商編碼 |
| req_summary_data_interval[*].network_layer_protocol | string | 否 | 網絡層協議:ipv4、ipv6,other |
| req_summary_data_interval[*].application_layer_protocol | string | 否 | 應用層協議:http,https,quic,other |
| req_summary_data_interval[*].abroad | int | 否 | 區域,國內(0),國外(1) |
| req_summary_data_interval[*].request_num | int | 否 | 請求數 |
| req_summary_data_interval[*].hit_request_rate | float | 否 | 請求命中率 |
| req_summary_data_interval[*].qps | float | 否 | QPS,單位:次/每秒 |
| req_summary_data_interval[*].hit_flow_rate | float | 否 | 流量命中率 |
| req_summary_data_interval[*].flow | long | 否 | 流量,單位Byte |
| req_summary_data_interval[*].hit_flow | long | 否 | 命中流量,單位Byte |
| req_summary_data_interval[*].bandwidth | float | 否 | 帶寬,單位bit/s(bps) |
示例:
請求路徑://cdnapi-global.ctapi.daliqc.cn/statistics/query-summary-data
示例1:
請求參數:
{
"start_time": 1667232000,
"end_time": 1667318400,
"interval": "1h",
"domain": "test.daliqc.cn",
"group_by": "application_layer_protocol",
"product_type": "004"
}
返回結果:
{
"code": 100000,
"message": "success",
"start_time": 1667232000,
"end_time": 1667318400,
"interval": "1h",
"req_summary_data_interval": [
{
"hit_request_rate": 25.33,
"time_stamp": 1667304000,
"hit_flow_rate": 16.55,
"qps": 2.08,
"bandwidth": 96205.68,
"request_num": 75,
"application_layer_protocol": "http",
"flow": 43292558,
"hit_flow": 7166584
},
{
"hit_request_rate": 0,
"time_stamp": 1667304000,
"hit_flow_rate": 0,
"qps": 0,
"bandwidth": 0,
"request_num": 0,
"application_layer_protocol": "other",
"flow": 0,
"hit_flow": 0
}
]
}
錯誤碼請參考:參數code和message含義