[关闭]
@rzzx 2017-05-12T02:41:45.000000Z 字数 2849 阅读 756

掌上听云客户端Server API接口-图表和情报汇总

Server

备注:情报汇总数据是和图表数据放在一起的,以字段来控制

文档中主机名需要参考以下配置:

内网:http://192.168.5.199:8083/tingyun-api-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'

1.应用一览图表

URL

/highcharts-chart-data/LATEST/account/mobileApplications/charts/{chartId}.json

示例URL

http://192.168.5.199:8083/tingyun-api-server/highcharts-chart-data/LATEST/account/applications/charts/application-apdex.json?_ty_auth_token=6r9vh9f1k0uqsw5fko5netevstqoltyz&applicationId=127206&instanceId=0&timeType=1&timePeriod=30&endTime=

请求参数

参数 必选 类型 说明
_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 时区

图表标题(写死)
响应数据

  1. /*成功响应*/
  2. {
  3. "status":200,
  4. "data":{
  5. "chart":{
  6. "series":[
  7. {
  8. "name":"应用层时间",
  9. "type":"line",
  10. "color":"#3598db",
  11. "summary":{
  12. "appLayerTime":{
  13. "value":"15.461毫秒",
  14. "name":"应用层时间"
  15. }
  16. },//这个字段只有请求showSummary=1时才展示
  17. "data":[
  18. {
  19. "x":1489730280000,
  20. "y":0
  21. },
  22. ...
  23. ],
  24. "params":"11"
  25. },
  26. ...
  27. ],
  28. "aggregateValue":0,
  29. "params":{
  30. "apdexT":0
  31. },
  32. "xAxis":[
  33. {
  34. "tickInterval":"%H:%M",//这个字段可能没有
  35. "type":"datetime"//这个字段可能没有
  36. },
  37. ...
  38. ],
  39. "yAxis":[
  40. {
  41. "tickUnit":"毫秒"//这个字段可能没有
  42. },
  43. ...
  44. ]
  45. },
  46. "type":null
  47. }
  48. }
  49. /*错误响应*/
  50. {
  51. "status":-1,
  52. "data":"_ty_auth_token is NULL"
  53. }
  54. /*错误响应*/
  55. {
  56. "status":-500,
  57. "message":"system error."
  58. }

2.关键应用过程一览图表

URL

highcharts-chart-data/LATEST/account/keyAction/charts/{chartId}.json

示例URL

http://192.168.5.199:8083/tingyun-api-server/highcharts-chart-data/LATEST/account/keyAction/charts/key-action-errors.json?_ty_auth_token=6vbxlik9lofeu14ehn0b2ucmt0terh7m&keyActionId=667&timeType=1&timePeriod=30&endTime=

请求参数

参数 必选 类型 说明
_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 时区

图表标题(写死)
响应数据

  1. /*成功响应*/
  2. {
  3. "status":200,
  4. "data":{
  5. "chart":{
  6. "series":[
  7. {
  8. "name":"www.cesuba.com",
  9. "color":"#5a4099",
  10. "type":"line",
  11. "data":[
  12. {
  13. "x":1462982400000,
  14. "y":3.104
  15. },
  16. {
  17. "x":1464537600000,
  18. "y":0.505
  19. }
  20. ],
  21. "params":"{"hostId":9}"
  22. },
  23. ...
  24. ],
  25. "aggregateValue":0.722,//平均值
  26. "xAxis":[
  27. {
  28. "tickInterval":"MM-dd HH:mm",
  29. "type":"datetime"
  30. }
  31. ],
  32. "yAxis":[
  33. {
  34. "tickUnit":"rpm"
  35. }
  36. ]
  37. },
  38. "type":null
  39. }
  40. }
  41. /*错误响应*/
  42. {
  43. "status":-1,
  44. "data":"_ty_auth_token is NULL"
  45. }
  46. /*错误响应*/
  47. {
  48. "status":-500,
  49. "message":"system error."
  50. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注