[关闭]
@rzzx 2016-10-09T06:10:52.000000Z 字数 4157 阅读 4373

掌上听云客户端App API接口-网络请求

App

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

内网:http://reportlocal.tingyun.com
外网:https://report.tingyun.com



概述

  1. 网络请求的HTTP页面(内网,F12出)
  2. 当排序后的select控件被选择时,会发出4ajax请求
  3. 1./mobileApplication/selectFilter/http/host.json
  4. 2./highcharts-chart-data/LATEST/accounts/mobileApplications/'charts/mobile-application-top-host-performance.json'
  5. 3./highcharts-chart-data/LATEST/accounts/mobileApplications/'charts/mobile-application-top-host-throughput.json'
  6. 4./highcharts-chart-data/LATEST/accounts/mobileApplications/'stacked/charts/mobile-application-top-slow-request-performance-host.json'
  7. 总结: (请求没有'号)1是tree树(网页左边)接口、2 3 4都是图表(网页右边)的接口 ,且4的请求格式和2 3请求格式有点区别

1.select控件(写死)

参数 baseonId
响应时间 1
吞吐率 3
响应时间耗时 4
平均传输数据量 5

2.tree树接口

2.1.父tree树接口

URL

/mobileApplication/selectFilter/http/host.json

请求参数

参数 必选 类型 说明
_ty_auth_token true string token从authlocal.tingyun.com:10886/auth/api/auth/login获取
baseonId true string select选择ID
mobileAppId true string 移动AppID
endTime false string 结束时间 格式如:yyyy-MM-dd HH:mm:ss
timePeriod false string 时间间隔 相差多少分钟
mobileAppVersionFilterId false String 版本号ID
timeZone false String 时区

响应数据

  1. 没什么用==没被赋值
  2. {
  3. "status":200,
  4. "data":[ {
  5. "pId" : "-2",//定死的,无意义
  6. "formatValue" : null,//没什么用
  7. "tmTick" : null,//没什么用
  8. "duration_total_caller_percent" : 0.0,//没什么用
  9. "jserror_top5_uri_percent" : 0.0,//没什么用
  10. "id" : "21",//服务器主机ID
  11. "name" : "www.baidu.com",
  12. "unit" : "KB",//单位
  13. "host_id" : 21,//服务器主机ID
  14. "host_ip" : 0,//没什么用
  15. "uri_id" : -1,//没什么用
  16. "serviceFlag" : true,//alias不为null时为true
  17. "alias" : "百度-服务",
  18. "value" : 48.616 //Point_count
  19. },
  20. ...
  21. ]}

子tree树接口

URL

/mobileApplication/selectFilter/http/host/uri.json

请求参数

参数 必选 类型 说明
_ty_auth_token true string token从authlocal.tingyun.com:10886/auth/api/auth/login获取
mobileAppId true string 移动AppID
hostId true string 父服务主机ID
baseonId true string select选择ID
endTime false string 结束时间 格式如:yyyy-MM-dd HH:mm:ss
timePeriod false string 时间间隔 相差多少分钟
mobileAppVersionFilterId false String 版本号ID
timeZone false String 时区

响应数据

  1. {
  2. "status":200,
  3. "data":[ {
  4. "pId" : "667",//父节点服务主机id
  5. "formatValue" : null,
  6. "tmTick" : null,
  7. "duration_total_caller_percent" : 0.0,
  8. "jserror_top5_uri_percent" : 0.0,
  9. "id" : "667-1",//id-深度
  10. "name" : "/*.gif",
  11. "unit" : "秒",
  12. "host_id" : 667,
  13. "host_ip" : 0,
  14. "uri_id" : 13,
  15. "serviceFlag" : false,
  16. "alias" : "",
  17. "value" : 7.19
  18. },
  19. ...
  20. ]}

3.图表JSON数据格式接口

1.不点击树

URL

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

请求参数

参数 必选 类型 说明
_ty_auth_token true string token从authlocal.tingyun.com:10886/auth/api/auth/login获取
mobileAppId true string 移动AppID
chartId true string 图表ID,一开始定死
timePeriod true string 时间间隔 相差多少分钟
hideLowerThroughtput true string 是否隐藏<1%的吞吐率(1为true)
endTime false string 结束时间 格式如:yyyy-MM-dd HH:mm:ss
mobileAppVersionFilterId false String 版本号ID
timeZone false String 时区

chartId讲解(这个有一个总表)

图表标题 chartId
TOP5 响应时间最慢主机 mobile-application-top-host-performance
TOP5吞吐率最高主机 mobile-application-top-host-throughput

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

  1. /*成功响应*/
  2. {
  3. "status":200,
  4. "data":{
  5. "chart":{
  6. "series":[
  7. {
  8. "name":"www.cesuba.com",
  9. "color":"#5a4099",
  10. "data":[
  11. {
  12. "x":1462982400000,
  13. "y":3.104
  14. },
  15. {
  16. "x":1464537600000,
  17. "y":0.505
  18. }
  19. ],
  20. "params":"{"hostId":9}"
  21. },
  22. ...
  23. ],
  24. "aggregateValue":0.722,//平均值
  25. "xAxis":[
  26. {
  27. "tickInterval":"MM-dd HH:mm",
  28. "type":"datetime"
  29. }
  30. ],
  31. "yAxis":[
  32. {
  33. "tickUnit":"rpm"
  34. }
  35. ]
  36. },
  37. "type":"area"
  38. }
  39. }

2.点击树

URL

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

点击子tree时,不需要传递hideLowerThroughtput

请求参数

参数 必选 类型 说明
_ty_auth_token true string token从authlocal.tingyun.com:10886/auth/api/auth/login获取
mobileAppId true string 移动AppID
hostId true string 父服务主机ID
baseonId true string select选择ID(在点击父tree时写死为1)
uriId true string 请求子tree的uri_id(只有点击子tree时请求图表时需要传的字段)
chartId true string 图表ID,一开始定死
timePeriod true string 时间间隔 相差多少分钟
hideLowerThroughtput true string 是否隐藏<1%的吞吐率(1为true)
endTime false string 结束时间 格式如:yyyy-MM-dd HH:mm:ss
mobileAppVersionFilterId false String 版本号ID
timeZone false String 时区

chartId讲解

图表标题 chartId
TOP5 响应时间最慢URL mobile-application-top-host-uri-performance
平均吞吐率 mobile-application-throughput
HTTP错误率 / 网络错误率 mobile-application-error

图表标题(写死)

响应数据

  1. /*成功响应*/
  2. {
  3. "status":200,
  4. "data":{
  5. "chart":{
  6. "series":[
  7. {
  8. "name":"POST /rqd/sync (https)",
  9. "color":"#5a4099",
  10. "data":[
  11. {
  12. "x":1463414400000,
  13. "y":5.83
  14. },
  15. {
  16. "x":1466265600000,
  17. "y":0.89
  18. },
  19. {
  20. "x":1466524800000,
  21. "y":0.715
  22. },
  23. {
  24. "x":1466784000000,
  25. "y":1.109
  26. }
  27. ],
  28. "params":"{"uriId":52840,"hostId":4738}"
  29. }
  30. ],
  31. "aggregateValue":0,
  32. "xAxis":[
  33. {
  34. "tickInterval":"MM-dd HH:mm",
  35. "type":"datetime"
  36. }
  37. ],
  38. "yAxis":[
  39. {
  40. "tickUnit":"秒"
  41. }
  42. ]
  43. },
  44. "type":"line"
  45. }
  46. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注