<接口地址>:/siteapi/data/task/statistics/trend
<请求方式>:GET
<数据类型>:JSON
<响应类型>:JSON
<请求参数>:
参数名称 | 是否必须 | 类型 | 默认值 | 描述 |
task_id | 是 | int | 无 | 任务id |
start_time | 否 | datetime | 当天开始时间 | 开始时间(与end_time需同时设置才生效) |
end_time | 否 | datetime | 当前时间 | 结束时间(与start_time同时设置才生效) |
monitor_id | 否 | Int | 无 | 监测点id(默认为任务平均) |
<响应数据>:
参数名称 | 数据类型 | 描述 |
data | Array | 返回结果 |
data.time | Array | 时间刻度 |
data.data | Array | 数据节点 |
data.data.name | string | 趋势图的名称 |
data.data.name_en | string | 趋势图的名称(英文) |
data.data.data | Array | 趋势图的数据列表 |
<请求示例>:
curl -H "token:a3af84f7c1d0d935024ba58b5da78aaa" https://v6-api.jiankongbao.com/siteapi/data/task/statistics/trend?task_id=64&start_time=2016-01-01&end_time=2018-01-01&monitor_id=1
<响应示例>:
{ "data": { "time": [ "00:00", "01:00", "02:00", "03:00", "04:00", "05:00", "06:00", "07:00", "08:00", "09:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00", "19:00", "20:00", "21:00" ], "data": [ { "name": "平均响应时间", "name_en": "resp_time_avg", "data": [ 2032.32, 2052.56, 2293.63, 2054.19, 2054.67, 2162.48, 2260.56, 2288.63, 2242, 2248.34, 2169.96, 2219.14, 2172.61, 2012.1, 2164.54, 1991.69, 2138.9, 1965.45, 2095.97, 1963.76, 1885.18, 1837.92 ] }, { "name": "平均可用率", "name_en": "avail_rate_avg", "data": [ 94.96, 95.97, 92.38, 95.85, 96.08, 95.55, 95.93, 96.25, 95.98, 95.91, 96.04, 95.23, 95.87, 96.44, 96.23, 96, 95.72, 96.22, 96.01, 96.84, 96.11, 96.18 ] }, { "name": "平均响应时间(可用)", "name_en": "avail_resp_time_avg", "data": [ 2034.13, 2051.57, 2111.28, 2063.38, 2063.79, 2172.15, 2270.94, 2299.17, 2252.37, 2258.6, 2180.01, 2242.44, 2182.48, 2020.58, 2174.4, 2000.88, 2148.54, 1974.17, 2105.33, 1972.02, 1892.93, 1846.17 ] }, { "name": "平均丢包率", "name_en": "loss", "data": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] } ] } }