[关闭]
@rzzx 2017-07-25T03:50:56.000000Z 字数 3871 阅读 801

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

Browser

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

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

内网:http://192.168.5.73:8084/tingyun-api-browser
外网:



情报汇总(summary)字段表

字段 类型 说明 讲解
serRepTime string 服务端响应时间 平均值,serRepTime可能没有(下同)
htmlLoadTime string HTML加载 平均值
pageRender string 页面渲染 平均值
fulLoad obj[] 完全加载 平均值
satisfiedCount string 满意的次数 平均值
tolerableCount string 可忍受的次数 平均值
frustratedCount string 令人沮丧的次数 平均值
SucPCount string 成功访问的次数 平均值
realSamp string 真实样本 总值
overSamp string 采样样本 总值
indexStalled String Stalled 总值
indexDns String DNS 总值
indexConn String 建连 总值
indexFirPacket String 首包 总值
indexSerRepTime String 服务端响应时间 总值
indexSsl String SSL 总值
indexRemPacket String 剩余包 总值
indexDomDispose String DOM处理 总值
indexResLoad String 资源加载 总值
indexHtmlLoadTime String HTML加载 总值
indexPageRender String 页面渲染 总值
indexFulLoad String 完全加载 总值
indexFirRenTime String 首次渲染时间 总值
indexFirstInterTime String 首次交互时间 总值
indexCusLoadTime String 自定义加载时间 总值
throRate String 吞吐率 平均值
jsErrRate String js错误率 平均值

图表JSON数据如果只需要中文,需请求数据头文件里声明'X-Accept-Language': 'zh-cn'

1.应用分析图表调用方式

URL

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

示例URL

http://192.168.5.73:8084/tingyun-api-browser/highcharts-chart-data/LATEST/account/browser/charts/browser-page-load-time.json?_ty_auth_token=84udvgrxpb389wf7q2rcgdcorm2krgud&browserAppId=445&timeType=1&timePeriod=129600&showSummary=1

请求参数

参数 必选 类型 说明
_ty_auth_token true string token从authlocal.tingyun.com:10886/auth/api/auth/login获取
browserAppId true string browserAppID
chartId true string 图表ID,一开始定死
timePeriod true string 时间间隔 相差多少分钟
timeType true int 时间计算类型(先默认为1)
showSummary false int 是否展示情报汇总数据(1 or 0,默认是0)
showLabel false int 是否展示图例数据(1 or 0,默认是0,只针对browser-map-region中国地图和browser-map-city省市地图有效)
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":"area",
  10. "color":"#3598db",
  11. "data":[
  12. {
  13. "x":1491494400000,
  14. "y":0.1
  15. },
  16. ...
  17. ],
  18. "params":"436"
  19. },
  20. ...
  21. ],
  22. "summary":{
  23. "serRepTime":{
  24. "value":"0.100秒",
  25. "name":"服务端响应时间"
  26. },
  27. "htmlLoadTime":{
  28. "value":"1.385秒",
  29. "name":"HTML加载"
  30. },
  31. "pageRender":{
  32. "value":"17.221秒",
  33. "name":"页面渲染"
  34. }
  35. },
  36. "label":[
  37. {
  38. "gte":"0.0",//大于等于
  39. "lt":"1.0",//小于
  40. "label":"0-1"//显示的内容
  41. },
  42. {
  43. "gte":"1.0",
  44. "lt":"2.0",
  45. "label":"1-2"
  46. },
  47. ...
  48. ],
  49. "xAxis":[
  50. {
  51. "gridLineColor":"#c0c0c0",
  52. "gridLineDashStyle":"ShortDot",
  53. "gridLineWidth":1,
  54. "tickInterval":"MM-dd HH:mm",
  55. "type":"datetime"
  56. }
  57. ],
  58. "yAxis":[
  59. {
  60. "tickUnit":"秒"
  61. }
  62. ]
  63. },
  64. "type":null
  65. }
  66. }
  67. /*错误响应*/
  68. {
  69. "status":-1,
  70. "data":"_ty_auth_token is NULL"
  71. }
  72. /*错误响应*/
  73. {
  74. "status":-500,
  75. "message":"system error."
  76. }

Label颜色:
(8种时从上到下)"#ea4139", "#eb6a37", "#f29a45", "#deca57", "#8fc178", "#68b960", "#54ac4c", "#4ea046"

(10种时从上到下)"#ea4139", "#eb6137", "#ef853f", "#ebaa4b", "#d5c95b", "#98c274", "#75bc68", "#5fb357", "#53a94b", "#4ea046"

2.关键页面图表调用方式(与应用分析调用方式一样)

URL

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

示例URL

http://192.168.5.73:8084/tingyun-api-browser/highcharts-chart-data/LATEST/account/browser/charts/browser-keypage-page-performance.json?_ty_auth_token=84udvgrxpb389wf7q2rcgdcorm2krgud&browserAppId=7069&browserKeyPageId=448&timeType=1&timePeriod=129600

请求参数

参数 必选 类型 说明
_ty_auth_token true string token从authlocal.tingyun.com:10886/auth/api/auth/login获取
browserAppId true int browserAppID
browserKeyPageId 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":"服务端响应时间",
  9. "type":"area",
  10. "color":"#3598db",
  11. "data":[
  12. {
  13. "x":1491494400000,
  14. "y":0.1
  15. },
  16. ...
  17. ],
  18. "params":"436"
  19. },
  20. ...
  21. ],
  22. "summary":{
  23. "serRepTime":{
  24. "value":"0.100秒",
  25. "name":"服务端响应时间"
  26. },
  27. "htmlLoadTime":{
  28. "value":"1.385秒",
  29. "name":"HTML加载"
  30. },
  31. "pageRender":{
  32. "value":"17.221秒",
  33. "name":"页面渲染"
  34. }
  35. },
  36. "xAxis":[
  37. {
  38. "gridLineColor":"#c0c0c0",
  39. "gridLineDashStyle":"ShortDot",
  40. "gridLineWidth":1,
  41. "tickInterval":"MM-dd HH:mm",
  42. "type":"datetime"
  43. }
  44. ],
  45. "yAxis":[
  46. {
  47. "tickUnit":"秒"
  48. }
  49. ]
  50. },
  51. "type":null
  52. }
  53. }
  54. /*错误响应*/
  55. {
  56. "status":-1,
  57. "data":"_ty_auth_token is NULL"
  58. }
  59. /*错误响应*/
  60. {
  61. "status":-500,
  62. "message":"system error."
  63. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注