跳到主要内容

页面分析

POST /page/list

请求参数类型必选参数说明
mpIdNumber小程序id
timePeriodNumber参数为默认为30分钟
endTimeString截止时间 格式yyyy-MM-dd HH:mm 例如(2018-02-07 17:39)
orderByString排序指标名称, 指标名称见列表
orderTypeStringasc: 正序, desc: 倒序 不传按默认(正序)

返回结果:

[
{
"path": "/page/index/index",
"alias": "首页",
"pv": 100,
"uv": 100,
"onReady": 800,
"firstResponse": 800,
"responseTime": 800,
"netErrorRate": 15,
"jsErrorRate": 10,
"applicationServerTime": 1,
"firstLoadTime": 111,
"stuckRate": 10,
"exQuitRate": 30,
"focus": false // 是否是关键页面
},
...
]

页面分析详情

页面性能趋势图

POST /chart/page-performance

说明:

获取页面性能指标图, 指标列表: UV, PV, onReady, 首次响应, 加载耗时

请求参数类型必选参数说明
mpIdNumber小程序id
pathString页面路由路径
timePeriodNumber参数为默认为30分钟
endTimeString截止时间 格式yyyy-MM-dd HH:mm 例如(2018-02-07 17:39)
quantileNumber分位值(50, 75, 95, 99), 不传取平均值

返回结果: (图公共返回结果)

网络请求趋势图

POST /chart/net-request-trend

说明:

获取页面下网络性能指标图, 指标列表: 请求次数, 慢请求次数, 错误请求次数, 请求耗时,服务端耗时

请求参数类型必选参数说明
mpIdNumber小程序id
pathString页面路由路径
timePeriodNumber参数为默认为30分钟
endTimeString截止时间 格式yyyy-MM-dd HH:mm 例如(2018-02-07 17:39)
quantileNumber分位值(50, 75, 95, 99), 不传取平均值

返回结果: Highcharts图通用返回结果

卡顿率趋势图

POST /chart/stuck-performance

说明:

获取页面下的卡顿相关性能, 图上横轴指标列表: PV, 卡顿PV, 卡顿率 。均值指标: 卡顿率均值

请求参数类型必选参数说明
mpIdNumber小程序id
pathString页面路由路径
timePeriodNumber参数为默认为30分钟
endTimeString截止时间 格式yyyy-MM-dd HH:mm 例如(2018-02-07 17:39)
quantileNumber分位值(50, 75, 95, 99), 不传取平均值

返回结果:

{
"overview": {
"aggregateValue": 50 // 卡顿率均值,需要查整个时间段的卡顿率均值
},
// 下面是chart图公共返回结果
"series": [...],
"yAxis": [...]
}

耗时分布

onReady:

POST /chart/page-distribution-on-ready

首次响应:

POST /chart/page-distribution-first-response

网络响应时间:

POST /chart/page-distribution-response-time

服务端响应时间:

POST /chart/page-distribution-application-server-time

setData频率:

POST /chart/page-distribution-setdata-fr

setData耗时:

POST /chart/page-distribution-setdata-time

请求并发:

POST /chart/page-distribution-request-fr

加载耗时:

POST /chart/page-distribution-first-load-time

说明:

获取页面性能指标图直方分布

请求参数类型必选参数说明
mpIdNumber小程序id
pathString页面路由路径
timePeriodNumber参数为默认为30分钟
endTimeString截止时间 格式yyyy-MM-dd HH:mm 例如(2018-02-07 17:39)

返回结果:


{
"series": [
{
"name": "占比",
"unit": "%",
"data": [
0.00,
0.00,
0.00,
33.33,
0.00,
33.33,
33.33,
0.00
]
},
{
"name": "次数",
"unit": "",
"data": [
0,
0,
0,
1,
0,
1,
1,
0
]
}
]
}

地图组件

参考应用地图组件

额外参数:

请求参数类型必选参数说明
pathString页面名称

页面退出率趋势图

POST /chart/ex-quit-performance

说明:

指标: 页面异常率, 异常退出率, 总退出率

请求参数类型必选参数说明
mpIdNumber小程序id
pathString页面路由路径
timePeriodNumber参数为默认为30分钟
endTimeString截止时间 格式yyyy-MM-dd HH:mm 例如(2018-02-07 17:39)

返回结果: (图公共返回结果)

JS错误率图

POST /chart/jserror-rate

说明:

获取页面性能指标图

请求参数类型必选参数说明
mpIdNumber小程序id
pathString页面路由路径
timePeriodNumber参数为默认为30分钟
endTimeString截止时间 格式yyyy-MM-dd HH:mm 例如(2018-02-07 17:39)

返回结果: (图通用返回结果)

TOP5 微信版本JS错误率曲线图

POST /chart/wechart-jserror-rate

说明:

获取页面性能指标图

请求参数类型必选参数说明
mpIdNumber小程序id
pathString页面路由路径
timePeriodNumber参数为默认为30分钟
endTimeString截止时间 格式yyyy-MM-dd HH:mm 例如(2018-02-07 17:39)

返回结果: (图通用返回结果)

慢页面占比图

POST /chart/slow-page-pv

说明:

获取页面性能指标图

请求参数类型必选参数说明
mpIdNumber小程序id
pathString页面路由路径
timePeriodNumber参数为默认为30分钟
endTimeString截止时间 格式yyyy-MM-dd HH:mm 例如(2018-02-07 17:39)

返回结果: Highcharts图通用返回结果

异常追踪

TOP5维度指标饼图

POST /page/pie

说明:

根据维度 查询慢页面次数指标占比, 每一张饼图调用一次这个接口, 注意, 如果top5 占比不到100%, 需要多返回一个名称为Other的数据项, 数据值为总数减去top5的总和

dimension选项列表:

名称dimension
网络类型networkType
微信版本wechatVersion
地域和运营商regionId,carrierId
系统版本system
设备deviceType
小程序sdk版本sdkVersion

请求参数:

请求参数类型必选参数说明
mpIdNumber小程序id
dimensionTypeString维度key, 区分饼图类型, 参考dimension选项列表
timePeriodNumber参数为默认为30分钟
endTimeString截止时间 格式yyyy-MM-dd HH:mm 例如(2018-02-07 17:39)
pathString页面路由路径
statusFilterString异常类型,以,分隔, 例如异常状态全选时: slow,netError,jsError,stuck, 依次表示慢页面,网络错误,js错误,卡顿

返回结果:

[
{
"name": "2G",
"value": 1,
"dimension": {
"networkType": "2G"
}
},
...
{
"name": "Other", // top5之外数据记录, 没有dimension项
"value": 10
}
]

慢页面列表

POST /abnormal/slowpage/list

注意: 请求Content-Type: application/json

请求示例:

{
"timePeriod": 30,
"endTime": "",
"mpId": 111,
"path": "xxx",
"statusFilter": "slow,netError,jsError", // 参考饼图
"filter": [
{
"dimension": "ip",
"values": ["192.168.1.100", "192.168.1.111"],
"searchValue": "192.168.1"
},
{
"dimension": "regionId,carrierId",
"values": ["4811,12000", "4811,12000"]
}
...
]
}

返回数据:

[
{
"id": "32f5b6dd68a14eab9356a69b4d73ea9b", // traceId
"timestamp": "2018-11-07 10:07",
"mpId": 7771,
"ip": "192.168.254.102",
"uid": "97bee32c-b7fa-4dc5-9ec5-2498ce08dc4e",
"sid": "199d5ceb-f110-4851-9ed3-80c7532be915",
"firstResponseTime": 20128,
"region": "未知",
"city": "未知",
"carrier": "未知",
"wechatVersion": "Firefox 63.0",
"system": "Android", // 操作系统
"deviceType": "Nexus5", // 手机型号
"firstLoadTime" : 2000 //首次加载
},
...
]

错误请求列表

POST /abnormal/errorrequest/list

请求参数:

请求参数类型必选参数说明
mpIdNumber小程序id
timePeriodNumber参数为默认为30分钟
endTimeString截止时间 格式yyyy-MM-dd HH:mm 例如(2018-02-07 17:39)
pathString页面路由路径
serverTraceboolean是否只查询有servertrace的数据,否则不传此参数

返回数据:


[
{
"host": "10.128.1.42",
"uri": "/browser/list",
"timestamp": "2018-11-07 10:07",
"status": 421, // http 状态码
"trace": false, // 是否有trace
"failMessage": "xxxx",
"serverId": 100, //server 应用Id
"serverTraceId": "xxdjsodjoisdjo" //server traceId
},
...
]

慢请求列表

POST /abnormal/slowrequest/list

请求参数:

请求参数类型必选参数说明
mpIdNumber小程序id
timePeriodNumber参数为默认为30分钟
endTimeString截止时间 格式yyyy-MM-dd HH:mm 例如(2018-02-07 17:39)
pathString页面路由路径
serverTraceboolean是否只查询有servertrace的数据,否则不传此参数
minDurationNumber搜索最小响应时间
maxDurationNumber搜索最大响应时间

返回数据:

[
{
"host": "10.128.1.42",
"uri": "/browser/list",
"timestamp": "2018-11-07 10:07",
"responseTime": 27106,
"applicationServerTime": 8164,
"bytesSent": 22503,
"bytesReceived": 12212,
"status": 408,
"trace": true,
"serverId": 100,
"serverTraceId": "xxdjsodjoisdjo"
},
...
]

慢页面详情

慢页面详情数据

POST /abnormal/slowpage/detail

请求参数:

请求参数类型必选参数说明
mpIdNumber小程序id
timePeriodNumber参数为默认为30分钟
endTimeString截止时间 格式yyyy-MM-dd HH:mm 例如(2018-02-07 17:39)
traceIdString页面traceId

返回数据:

{
"header": {
"traceTime": "2019-11-26 14:00",
"path": "pages/index/index",
"totalLoadTime": null,
"width": "360",
"height": "518",
"system": "Android 5.0",
"deviceType": "Nexus 5",
"wechatVersion": "7.0.4",
"ip": "192.168.5.149",
"region": "未知",
"city": "未知",
"networkType": "wifi",
"carrier": "未知",
"firstResponse": 4261,
"responseTime": 1536,
"applicationServerTime": 0,
"onReady": 3076,
"customTime": 3021,
"v": null,
"ua": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Mobile Safari/537.36 wechatdevtools/1.02.1910120 MicroMessenger/7.0.4 webview/",
"pageEvent": {
"onHide": 1574748040507,
"onLoad": 1574748020897,
"onReady": 1574748023973,
"onShow": 1574748021416,
"onUnload": 0
},
"routeTrack": [
{
"timestamp": 1574748021416,
"route": "pages/index/index"
}
],
"metric": {
"jsError": true,
"netError": false,
"stuck": false,
"firstLoad": 6114
}
},
"waterFall": {
"domains": [
"reportalpha1.tingyun.com"
],
"items": [
{
"timestamp": "2019-11-26 14:00",
"name": "/demo-server/test/custom-request",
"timeOffset": 3080,
"type": "network",
"id": "fe0f64664ebf41b0ac696e549ea1ccb6",
"trace": true,
"host": "reportalpha1.tingyun.com",
"uri": "/demo-server/test/custom-request",
"url": "https://reportalpha1.tingyun.com/demo-server/test/custom-request?timeout=1000",
"httpCode": "200",
"applicationId": "0",
"instanceId": "0",
"serverId": "0",
"responseTime": 1181,
"applicationServerTime": 0,
"bytesSent": 0.0,
"bytesReceived": 0.012,
"start": 1574748023977,
"end": 1574748025158,
"netCount": 1,
"callbackTime": 4,
"requestMethod": "GET",
"serverTrace": false,
"serverTraceTime": 0,
"server": false,
"failMessage": "",
"requestId": 2,
"compareValue": 3080
},
{
"timestamp": "2019-11-26 14:00",
"name": "/demo-server/test/custom-request",
"timeOffset": 3087,
"type": "network",
"id": "8ce9ccfb8032484daa71be73682195c1",
"trace": true,
"host": "reportalpha1.tingyun.com",
"uri": "/demo-server/test/custom-request",
"url": "https://reportalpha1.tingyun.com/demo-server/test/custom-request?timeout=2000",
"httpCode": "200",
"applicationId": "0",
"instanceId": "0",
"serverId": "0",
"responseTime": 3006,
"applicationServerTime": 0,
"bytesSent": 0.0,
"bytesReceived": 0.012,
"start": 1574748023984,
"end": 1574748026990,
"netCount": 1,
"callbackTime": 1,
"requestMethod": "GET",
"serverTrace": false,
"serverTraceTime": 0,
"server": false,
"failMessage": "",
"requestId": 3,
"compareValue": 3087
},
{
"timestamp": "2019-11-26 14:00",
"timeOffset": 3106,
"type": "jserror",
"id": "XpFMpm4Bw-wCxOz_SUve",
"agentVersion": "1.3.6",
"applicationId": 0,
"carrierId": 0,
"cityId": 0,
"countryId": 0,
"instanceId": 0,
"mpId": 2065,
"errorMessage": "Random js error",
"ip": "192.168.5.149",
"deviceType": "Nexus 5",
"messageType": "JSERROR",
"networkType": "wifi",
"msgErrorPv": 1,
"occurTime": 1574748024003,
"openPath": "pages/index/index",
"path": "pages/index/index",
"pageTraceId": "5de76fa1a59e474d9dd1524a40ac8540",
"regionId": 0,
"sid": "68c6de32-d274-4db4-b28c-66e0e86d4a58",
"uid": "5847de28-2b35-4d6e-b977-ff54a685c7d4",
"scene": "1001",
"system": "Android 5.0",
"wechatVersion": "7.0.4",
"trace": false,
"traceData": {
"colno": 0,
"filename": null,
"msg": null,
"stack": "thirdScriptError\nRandom js error;at \"pages/index/index\" page lifeCycleMethod onShow function\nError: Random js error\n at _e.onShow (http://127.0.0.1:13201/appservice/pages/index/index.js:99:13)\n at _e.onShow (http://127.0.0.1:13201/appservice/agent/bundle.js:75:31)\n at _e.<anonymous> (http://127.0.0.1:13201/appservice/__dev__/WAService.js:1:1531191)\n at _e.p.__callPageLifeTime__ (http://127.0.0.1:13201/appservice/__dev__/WAService.js:1:1530936)\n at Tt (http://127.0.0.1:13201/appservice/__dev__/WAService.js:1:1546361)\n at http://127.0.0.1:13201/appservice/__dev__/WAService.js:1:1549664\n at xt (http://127.0.0.1:13201/appservice/__dev__/WAService.js:1:1550157)\n at Function.<anonymous> (http://127.0.0.1:13201/appservice/__dev__/WAService.js:1:1553690)\n at i.<anonymous> (http://127.0.0.1:13201/appservice/__dev__/WAService.js:1:1522455)\n at i.emit (http://127.0.0.1:13201/appservice/__dev__/WAService.js:1:551893)",
"ua": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Mobile Safari/537.36 wechatdevtools/1.02.1910120 MicroMessenger/7.0.4 webview/",
"lineno": 0,
"time": 1574748024003,
"onShow": null,
"onUnload": null,
"screenHeight": "640",
"screenWidth": "360",
"windowHeight": "518",
"windowWidth": "360",
"sdkVersion": "2.9.3"
},
"compareValue": 3106
}
],
"timeSpan": 6114
},
"setData": {
"max": 49,
"threshold": 1000,
"data": [
{
"timestamp": 1574748025158,
"count": 1,
"grade": {
"good": {
"count": 0
},
"normal": {
"count": 0
},
"bad": {
"count": 1
}
},
"traces": []
},
{
"timestamp": 1574748026990,
"count": 1,
"grade": {
"good": {
"count": 0
},
"normal": {
"count": 0
},
"bad": {
"count": 1
}
},
"traces": []
}
],
"setDataTimeInterval": [
1,
3
],
"setDataTrace": true,
"setDataTraceHint": true,
"requestBridge": [
{
"start": 1574748025158,
"end": 1574748025207,
"requestId": 2,
"url": "https://reportalpha1.tingyun.com/demo-server/test/custom-request?timeout=1000"
},
{
"start": 1574748026990,
"end": 1574748027011,
"requestId": 3,
"url": "https://reportalpha1.tingyun.com/demo-server/test/custom-request?timeout=2000"
}
]
}
}

最近慢页面的列表

POST /abnormal/slowpage/recent-list

请求参数:

请求参数类型必选参数说明
mpIdNumber小程序id
timePeriodNumber参数为默认为30分钟
endTimeString截止时间 格式yyyy-MM-dd HH:mm 例如(2018-02-07 17:39)
limitNumber默认查前20条trace记录 按时间倒排
[
{
"traceId": "f758c228c1e148ef8f6e792e1cd91fbf",
"timestamp": "2018-11-12 16:01"
}
]