@rzzx
2017-05-12T02:41:45.000000Z
字数 2849
阅读 756
Server
备注:情报汇总数据是和图表数据放在一起的,以字段来控制
文档中主机名需要参考以下配置:
情报汇总(summary)字段表
| 字段 | 类型 | 说明 | 讲解 |
|---|---|---|---|
| exSerTime | string | 外部服务时间 | 平均值,exSerTime可能没有(下同) |
| dataCallTime | string | 数据库调用时间 | 平均值 |
| appLayerTime | string | 应用层时间 | 平均值 |
| BlockTime | string | 阻塞时间 | 平均值 |
| MemcachedRepTime | string | Memcached响应时间 | 平均值 |
| MongoDBRepTime | string | MongoDB响应时间 | 平均值 |
| RedisRepTime | String | Redis响应时间 | 平均值 |
| satisfiedCount | int | 满意的次数 | 平均值 |
| tolerableCount | int | 可忍受的次数 | 平均值 |
| frustratedCount | int | 令人沮丧的次数 | 平均值 |
| SucPCount | int | 成功访问的次数 | 平均值 |
| percentOfErr | String | 错误百分比 | 平均值 |
| ErrCount | int | 错误量 | 总值 |
| ErrPCount | int | 错误访问量 | 总值 |
| ThroughPCount | int | 吞吐访问量 | 总值 |
图表JSON数据如果只需要中文,需请求数据头文件里声明'X-Accept-Language': 'zh-cn'
URL
/highcharts-chart-data/LATEST/account/mobileApplications/charts/{chartId}.json
示例URL
请求参数
| 参数 | 必选 | 类型 | 说明 |
|---|---|---|---|
| _ty_auth_token | true | string | token从authlocal.tingyun.com:10886/auth/api/auth/login获取 |
| applicationId | true | string | 移动AppID |
| chartId | true | string | 图表ID,一开始定死 |
| timePeriod | true | string | 时间间隔 相差多少分钟 |
| timeType | true | int | 时间计算类型(先默认为1) |
| showSummary | false | int | 是否展示情报汇总数据(1 or 0,默认是0) |
| endTime | false | string | 结束时间 格式如:yyyy-MM-dd HH:mm:ss |
| timeZone | false | String | 时区 |
图表标题(写死)
响应数据
/*成功响应*/{"status":200,"data":{"chart":{"series":[{"name":"应用层时间","type":"line","color":"#3598db","summary":{"appLayerTime":{"value":"15.461毫秒","name":"应用层时间"}},//这个字段只有请求showSummary=1时才展示"data":[{"x":1489730280000,"y":0},...],"params":"11"},...],"aggregateValue":0,"params":{"apdexT":0},"xAxis":[{"tickInterval":"%H:%M",//这个字段可能没有"type":"datetime"//这个字段可能没有},...],"yAxis":[{"tickUnit":"毫秒"//这个字段可能没有},...]},"type":null}}/*错误响应*/{"status":-1,"data":"_ty_auth_token is NULL"}/*错误响应*/{"status":-500,"message":"system error."}
URL
highcharts-chart-data/LATEST/account/keyAction/charts/{chartId}.json
示例URL
请求参数
| 参数 | 必选 | 类型 | 说明 |
|---|---|---|---|
| _ty_auth_token | true | string | token从authlocal.tingyun.com:10886/auth/api/auth/login获取 |
| keyActionId | true | string | 关键元素ID |
| chartId | true | string | 图表ID,一开始定死 |
| timePeriod | true | string | 时间间隔 相差多少分钟 |
| timeType | true | int | 时间计算类型(先默认为1) |
| endTime | false | string | 结束时间 格式如:yyyy-MM-dd HH:mm:ss |
| timeZone | false | String | 时区 |
图表标题(写死)
响应数据
/*成功响应*/{"status":200,"data":{"chart":{"series":[{"name":"www.cesuba.com","color":"#5a4099","type":"line","data":[{"x":1462982400000,"y":3.104},{"x":1464537600000,"y":0.505}],"params":"{"hostId":9}"},...],"aggregateValue":0.722,//平均值"xAxis":[{"tickInterval":"MM-dd HH:mm","type":"datetime"}],"yAxis":[{"tickUnit":"rpm"}]},"type":null}}/*错误响应*/{"status":-1,"data":"_ty_auth_token is NULL"}/*错误响应*/{"status":-500,"message":"system error."}