跳到主要内容

操作分析

操作列表

POST /opera/list

请求参数类型必选参数说明
mpIdNumber小程序id
timePeriodNumber参数为默认为30分钟
endTimeString截止时间 格式yyyy-MM-dd HH:mm 例如(2018-02-07 17:39)
requestOnlyboolean过滤无网络请求的操作, 默认true

返回数据:


[
{
"operaName": "getReport",
"path": "pages/index/index",
"operaAliasName": "获取报告",
"operaCount": 2,
"operaRequestCount": 1,
"operaTime": 482.0,
"operaRequestTime": 455.0,
"operaServerTime": 0.0,
"operaAvailableRate": 0.0
},
...
]

操作详情

操作用户体验图

POST /chart/opera-performance-trend

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

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

耗时分布

操作时间:

POST /chart/opera-distribution-time

操作请求耗时:

POST /chart/opera-distribution-request-time

操作服务端耗时:

POST /chart/opera-distribution-server-time

请求参数类型必选参数说明
mpIdNumber小程序id
operaNameString操作名称
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
]
}
]
}

地图组件

参考应用地图组件

额外参数:

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

异常追踪

TOP5维度指标饼图

POST /opera/pie

dimension选项列表:

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

请求参数:

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

返回结果:

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

操作trace列表

POST /opera/trace/list

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

请求示例:

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

返回数据:

[
{
"timestamp": "2019-11-27 15:16",
"id": "YpG4q24Bw-wCxOz_N0tj",
"path": "pages/index/index",
"operaName": "sendOneRequest",
"sid": "48cac7ec-7a22-48b0-bc5f-93c3e957abef",
"uid": "5847de28-2b35-4d6e-b977-ff54a685c7d4",
"ip": "192.168.5.149",
"system": "Android 5.0",
"deviceType": "Nexus 5",
"wechatVersion": "7.0.4",
"networkType": "wifi",
"regionId": 0,
"cityId": 0,
"carrierId": 0,
"region": "未知",
"city": "未知",
"carrier": "未知",
"operaTime": 1604,
"operaRequestTime": 1603,
"operaServerTime": 0,
"operaRequestCount": 1,
"operaServerCount": 0
},
...
]

请求分析

POST /opera/request-list

请求参数:

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

返回数据:

[
{
"netCount": 3,
"applicationServerTime": 0,
"netErrorRate": 0.0,
"netSlowRatio": 0.0,
"responseTime": 84.0,
"host": "demo.tingyun.com",
"uri": "/mp-mock/baidu/list"
}
]

操作trace

操作trace详情

POST /opera/trace/detail

请求参数:

请求参数类型必选参数说明
mpIdNumber小程序id
pathString页面路径
operaNameString操作名称
timePeriodNumber参数为默认为30分钟
endTimeString截止时间 格式yyyy-MM-dd HH:mm 例如(2018-02-07 17:39)
traceIdString操作traceId, 操作trace列表的id字段

返回数据:


{
"timestamp": "2019-11-27 15:16",
"mpId": 2065,
"path": "pages/index/index",
"operaName": "sendOneRequest",
"sid": "48cac7ec-7a22-48b0-bc5f-93c3e957abef",
"uid": "5847de28-2b35-4d6e-b977-ff54a685c7d4",
"ip": "192.168.5.149",
"system": "Android 5.0",
"deviceType": "Nexus 5",
"wechatVersion": "7.0.4",
"networkType": "wifi",
"countryId": 0,
"regionId": 0,
"cityId": 0,
"carrierId": 0,
"region": "未知",
"city": "未知",
"carrier": "未知",
"traceData": {
"data": {
"dataset": {
"methodName": "sendOneRequest"
},
"target": {
"offsetTop": 829,
"x": 193,
"y": 851,
"offsetLeft": 0,
"id": ""
}
},
"prev_path": "pages/about/about",
"count": 0,
"start": 1574839003687,
"requests": [
{
"status_code": 500,
"method": "GET",
"prev_path": "pages/about/about",
"count": 0,
"start": 1574839003687,
"server_instance_id": 0,
"type": "request",
"server_id": 0,
"opera_name": "sendOneRequest",
"url": "https://reportalpha1.tingyun.com/mpserver/filesuccess",
"fail_message": "{\"code\":\"success\"}",
"duration": 1603,
"path": "pages/index/index",
"rec": 18,
"requestId": 1,
"cb_time": 0,
"end": 1574839005290,
"id": 0,
"send": 0
}
],
"type": "event",
"duration": 1604,
"path": "pages/index/index",
"apis": [],
"name": "sendOneRequest",
"end": 1574839005291,
"id": 1,
"info": {
"windowHeight": 518,
"routeTrack": [
{
"route": "pages/index/index",
"timestamp": 1574838982066
},
{
"route": "pages/about/about",
"timestamp": 1574838991094
},
{
"route": "pages/index/index",
"timestamp": 1574839000551
}
],
"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/",
"windowWidth": 360
}
},
"operaTime": 1604,
"operaRequestTime": 1603,
"operaServerTime": 0,
"operaRequestCount": 1,
"operaServerCount": 0
}

最近操作trace列表

POST /opera/trace/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"
}
]