跳到主要内容

请求分析

1. 丢包率

Endpoint:

Method: POST
Type: RAW
URL: {{host}}/adhoc/query

Body:

{
"timePeriod": {{timePeriod}},
"endTime": {{endTime}},
"datasource": "APP_NETWORK_DATA",
"metrics": [
"packetLossRate"
],
"dimensions": [
"timeStr"
],
"filters": [
{
"name": "countryId",
"value": [
48
],
"groupType": "region"
},
{
"name": "mobileAppId",
"value": [
{{mobileAppId}}
],
"operator": "IN"
}
],
"limit": -1,
"avg": {
"metric": "packetLossRate"
},
"render": "list",
"contentType": "json"
}

Example Request: 丢包率

Body:

{
"timePeriod": {{timePeriod}},
"endTime": {{endTime}},
"datasource": "APP_NETWORK_DATA",
"metrics": [
"packetLossRate"
],
"dimensions": [
"timeStr"
],
"filters": [
{
"name": "countryId",
"value": [
48
],
"groupType": "region"
},
{
"name": "mobileAppId",
"value": [
{{mobileAppId}}
],
"operator": "IN"
}
],
"limit": -1,
"avg": {
"metric": "packetLossRate"
},
"render": "list",
"contentType": "json"
}

Example Response: 丢包率

[
{
"packetLossRate": "71.06",
"timeStr": 1629950220000
},
{
"packetLossRate": "71.43",
"timeStr": 1629950400000
}
]

Status Code: 200

2. 关键请求列表

Endpoint:

Method: POST
Type: RAW
URL: {{host}}/adhoc/query

Body:

{
"timePeriod": {{timePeriod}},
"endTime": {{endTime}},
"datasource": "APP_NETWORK_DATA",
"metrics": [
"requestCount",
"responseTime",
"requestErrorRate",
"httpErrorRate",
"networkErrorRate",
"throughput"
],
"dimensions": [
"keyUrlId"
],
"filters": [
{
"name": "mobileAppId",
"value": [
{{mobileAppId}}
],
"operator": "IN"
},
{
"name": "keyUrlId",
"value": [
0
],
"operator": ">"
},
{
"name": "countryId",
"value": [
48
],
"groupType": "region"
}
],
"orderByExprs": "requestCount desc",
"render": "list"
}

3. 响应时间百分位

Endpoint:

Method: POST
Type: RAW
URL: {{host}}/adhoc/query

Body:

{
"timePeriod": {{timePeriod}},
"endTime": {{endTime}},
"datasource": "APP_NETWORK_DATA_SKETCH",
"queryMetrics": [
{
"name": "requestCount",
"type": "tooltip"
},
{
"name": "responseTime50"
},
{
"name": "responseTime75"
},
{
"name": "responseTime95"
},
{
"name": "responseTime99"
}
],
"dimensions": [

],
"filters": [
{
"name": "countryId",
"value": [
48
],
"groupType": "region"
},
{
"name": "mobileAppId",
"value": [
{{mobileAppId}}
],
"operator": "IN"
}
],
"limit": -1,
"render": "list"
}

More example Requests/Responses:

Example Request: 响应时间百分位

Body:

{
"timePeriod": {{timePeriod}},
"endTime": {{endTime}},
"datasource": "APP_NETWORK_DATA_SKETCH",
"queryMetrics": [
{
"name": "requestCount",
"type": "tooltip"
},
{
"name": "responseTime50"
},
{
"name": "responseTime75"
},
{
"name": "responseTime95"
},
{
"name": "responseTime99"
}
],
"dimensions": [

],
"filters": [
{
"name": "countryId",
"value": [
48
],
"groupType": "region"
},
{
"name": "mobileAppId",
"value": [
{{mobileAppId}}
],
"operator": "IN"
}
],
"limit": -1,
"render": "list"
}

Example Response: 响应时间百分位

// 单位 ms
[
{
"responseTime99": 5074, // 99分位
"responseTime75": 142, // 75分位
"responseTime95": 576, // 95分位
"responseTime50": 89 // 50分位
}
]

Status Code: 200

4. 响应时间百分位趋势

Endpoint:

Method: POST
Type: RAW
URL: {{host}}/adhoc/query

Body:

{
"timePeriod": {{timePeriod}},
"endTime": {{endTime}},
"datasource": "APP_NETWORK_DATA_SKETCH",
"queryMetrics": [
{
"name": "requestCount",
"type": "tooltip"
},
{
"name": "responseTime50"
},
{
"name": "responseTime75"
},
{
"name": "responseTime95"
},
{
"name": "responseTime99"
}
],
"dimensions": [
"timeStr"
],
"filters": [
{
"name": "countryId",
"value": [
48
],
"groupType": "region"
},
{
"name": "mobileAppId",
"value": [
{{mobileAppId}}
],
"operator": "IN"
}
],
"limit": -1,
"render": "list"
}

Example Request: 响应时间百分位趋势

Body:

{
"timePeriod": {{timePeriod}},
"endTime": {{endTime}},
"datasource": "APP_NETWORK_DATA_SKETCH",
"queryMetrics": [
{
"name": "requestCount",
"type": "tooltip"
},
{
"name": "responseTime50"
},
{
"name": "responseTime75"
},
{
"name": "responseTime95"
},
{
"name": "responseTime99"
}
],
"dimensions": [
"timeStr"
],
"filters": [
{
"name": "countryId",
"value": [
48
],
"groupType": "region"
},
{
"name": "mobileAppId",
"value": [
{{mobileAppId}}
],
"operator": "IN"
}
],
"limit": -1,
"render": "list"
}

Example Response: 响应时间百分位趋势

[
{
"responseTime99": 5074, // 99分位
"responseTime75": 142, // 75分位
"responseTime95": 576, // 95分位
"responseTime50": 89, // 50分位
"timeStr": 1629786240000
},
{
"responseTime99": 4661,
"responseTime75": 185,
"responseTime95": 1011,
"responseTime50": 103,
"timeStr": 1629786360000
}
]

Status Code: 200

5. 域名请求列表

Endpoint:

Method: POST
Type: RAW
URL: {{host}}/adhoc/query

Body:

{
"timePeriod": {{timePeriod}},
"endTime": {{endTime}},
"datasource": "APP_NETWORK_DATA",
"metrics": [
"requestCount",
"throughput",
"responseTime",
"networkTime",
"dnsTime",
"httpErrorRate",
"connectTime",
"sslTime",
"firstPacketTime",
"remainPacketTime",
"localQueueTime",
"networkErrorRate",
"trafficConsumption",
"networkSpeed",
"bytesSend",
"bytesReceived",
"httpErrorCount",
"networkErrorCount",
"slowCount",
"slowRequestRate"
],
"dimensions": [
"hostId",
"requestType"
],
"filters": [
{
"name": "countryId",
"value": [
48
],
"groupType": "region"
},
{
"name": "mobileAppId",
"value": [
{{mobileAppId}}
],
"operator": "IN"
}
],
"orderByExprs": "requestCount DESC",
"limit": 1000,
"render": "list"
}

Example Request: 域名请求列表

Body:

{
"timePeriod": {{timePeriod}},
"endTime": {{endTime}},
"datasource": "APP_NETWORK_DATA",
"metrics": [
"requestCount",
"throughput",
"responseTime",
"networkTime",
"dnsTime",
"httpErrorRate",
"connectTime",
"sslTime",
"firstPacketTime",
"remainPacketTime",
"localQueueTime",
"networkErrorRate",
"trafficConsumption",
"networkSpeed",
"bytesSend",
"bytesReceived",
"httpErrorCount",
"networkErrorCount",
"slowCount",
"slowRequestRate"
],
"dimensions": [
"hostId",
"requestType"
],
"filters": [
{
"name": "countryId",
"value": [
48
],
"groupType": "region"
},
{
"name": "mobileAppId",
"value": [
{{mobileAppId}}
],
"operator": "IN"
}
],
"orderByExprs": "requestCount DESC",
"limit": 1000,
"render": "list"
}

Example Response: 域名请求列表

[
{
"requestCount": 2976,
"hostName": "zhihu.com",
"requestType": 2,
"trafficConsumption": "5025.195",
"responseTime": 2509,
"localQueueTime": 34,
"networkErrorCount": 744,
"hostId": 9514,
"requestTypeName": "cdn-self service",
"slowCount": 744,
"networkTime": 2475,
"httpErrorRate": "50",
"remainPacketTime": 60,
"networkErrorRate": "25",
"networkSpeed": "2002.09",
"bytesReceived": "1.367",
"slowRequestRate": "25",
"dnsTime": 123,
"connectTime": 49,
"sslTime": 108,
"firstPacketTime": 223,
"throughput": "16.533",
"bytesSend": "5023.828",
"httpErrorCount": 1488
}
]

Status Code: 200

6. 网络延迟

Endpoint:

Method: POST
Type: RAW
URL: {{host}}/adhoc/query

Body:

{
"timePeriod": {{timePeriod}},
"endTime": {{endTime}},
"datasource": "APP_NETWORK_DATA",
"metrics": [
"pingTime",
"pingSuccessCount"
],
"dimensions": [
"timeStr"
],
"filters": [
{
"name": "countryId",
"value": [
48
],
"groupType": "region"
},
{
"name": "mobileAppId",
"value": [
{{mobileAppId}}
],
"operator": "IN"
}
],
"limit": -1,
"avg": {
"metric": "pingTime"
},
"render": "list",
"contentType": "json"
}

Example Request: 网络延迟

Body:

{
"timePeriod": {{timePeriod}},
"endTime": {{endTime}},
"datasource": "APP_NETWORK_DATA",
"metrics": [
"pingTime",
"pingSuccessCount"
],
"dimensions": [
"timeStr"
],
"filters": [
{
"name": "countryId",
"value": [
48
],
"groupType": "region"
},
{
"name": "mobileAppId",
"value": [
{{mobileAppId}}
],
"operator": "IN"
}
],
"limit": -1,
"avg": {
"metric": "pingTime"
},
"render": "list",
"contentType": "json"
}

Example Response: 网络延迟

[
{
"pingTime": 1810, // ping耗时
"pingSuccessCount": 270, // ping成功次数
"timeStr": 1629950220000 // 时间戳
},
{
"pingTime": 1769,
"pingSuccessCount": 490,
"timeStr": 1629950400000
}
]

Status Code: 200