Skip to main content

General Data Index Query System

1. Performance Metrics-General Query

For performance data indicators, it is often necessary to perform multi-dimension and multi-indicator cross query, so an indicator query method is provided, which is described in JSON language as follows.

Examples

An example of an indicator trend chart:

{
"timePeriod": 180,
"endTime":"2020-02-19 23:10"
"datasource": "APP_BASE_DATA",
"metrics": [
"loadDuration",
"viewDuration",
"slowLoadPercent",
"throughput"
],
"dimensions": [
"timeStr"
],
"orderByExprs": "slowLoadPercent desc",
"havingExprs": "viewDuration>10",
"render":"csv",
"top": {
"metric": "loadDuration",
"direction": "desc",
"dimensions": [
"mobileAppId"
],
"limit": 5
}
}

Property description

propertydescriptionMandatory
timePeriodStart Time-End Interval Minutesyes
endTimeEnd time, format YYYY-MM-DD HH: mm, not specified as current timeno
datasourceMetric data sourceyes
metricsIndicator itemyes
filtersFilter condition, only filter1 and filter2 are supportedyes
dimensionsGrouping dimensionsno
orderByExprsSort expression, must be an item in metricno
havingExprsGrouping filter expression, meaning refers to SQL having, the field must be metricno
renderRenderer, support list, CSV, chartno
topSecondary query means to query based on top first, and then return the value in. It can be understood as an in subquery, which is commonly used in the topN trend chart of the reportno

DSL->SQL

Equivalent to the example converted to SQL, non-standard SQL mode:

SELECT 
[dimensions],
[metric]
FROM
[datasource]
WHERE
[time]<=[endtime] AND [time]>[endTime-timePeriod] AND [filters] AND [top.dimensions] IN (topQuery)
GROUP BY [dimensions]
HAVING [havingExprs]
ORDER BY [orderByExprs]

Renderer

Render models, currently supports the following:

  • list
  • csv
  • chart
  • object
list

Simplified JSON format:

[
{
"requestCount": "879",
"uriId": "1",
"requestType": "2",
"trafficConsumption": "3",
"responseTime": "3172",
"networkErrorCount": "83",
"requestTypeName": "CDN-Self-service",
"slowCount": "170",
"httpErrorRate": "8.3",
"networkErrorRate": "9.44",
"networkSpeed": "1",
"uriName": "/user",
"throughput": "14.65",
"httpErrorCount": "73"
}
]
csv

CSV table format:

timeStr,View load milliseconds,Slow load percentage%,Slow rendering percentage%,View rendering milliseconds
2019-4-23 8:00:00,1525,0,0,2430
2019-4-26 8:00:00,987,0,0,2460
2019-4-28 8:00:00,978,0,0,2521
2019-4-30 8:00:00,286,0,0,286
2019-5-5 8:00:00,835,0,0,892
2019-5-6 8:00:00,517,0,0,685
2019-5-10 8:00:00,111,0,0,292
2019-5-13 8:00:00,80,0,0,216
2019-5-14 8:00:00,589,0,0,652

object

Different from the list mode, the unit and format string of the indicator will be output:

[
{
"loadDuration": {
"format": "987",
"label": "View loading",
"unit": "milliseconds",
"value": 987
},
"slowLoadPercent": {
"format": "0",
"label": "Slow load percentage",
"unit": "%",
"value": 0
},
"timeStr": 1556236800000,
"throughput": {
"format": "0",
"label": "Slow rendering percentage",
"unit": "%",
"value": 0
},
"viewDuration": {
"format": "2460",
"label": "View rendering",
"unit": "milliseconds",
"value": 2460
}
}
]
chart

Data style in hightchart format:

{
"series": [
{
"data": [
{
"x": 1556236800000,
"y": 987,
"tooltip": {
"data": [
{
"unit": "milliseconds",
"title": "View loading",
"value": 987
},
{
"unit": "%",
"title": "Slow load percentage",
"value": 0
},
{
"unit": "%",
"title": "Slow rendering percentage",
"value": 0
},
{
"unit": "milliseconds",
"title": "View rendering",
"value": 2460
}
],
"title": "04-26 08:00--04-27 08:00"
}
}
],
"name": "View loading",
"type": "line",
"yAxis": 0,
"zIndex": 1
}
],
"yAxis": [
{
"i18n": "app.unit.ms",
"opposite": false,
"tickUnit": "milliseconds"
},
{
"i18n": "app.unit.percent",
"opposite": true,
"tickUnit": "%"
}
]
}

Query example

Time trend chart
{
"timePeriod": 43200,
"datasource": "APP_BASE_DATA",
"metrics": [
"loadDuration",
"viewDuration",
"slowLoadPercent",
"throughput"
],
"dimensions": [
"timeStr"
],
"havingExprs": "viewDuration>10"
}

TOP5 time trend chart
{
"timePeriod": 43200,
"datasource": "APP_BASE_DATA",
"filters": [
{
"name": "regionId",
"value": [4811,4812,4813,4814,4815],
"operator": "IN"
}
],
"metrics": [
"loadDuration",
"viewDuration",
"slowLoadPercent"
],
"dimensions": ["timeStr"]
}
Average time consumption of TOP10 in descending order of slow loading rate > 10
{
"timePeriod": 43200,
"datasource": "APP_BASE_DATA",
"metrics": [
"loadDuration",
"viewDuration",
"slowLoadPercent",
"throughput"
],
"dimensions": [
"mobileAppId"
],
"orderByExprs": "slowLoadPercent desc",
"havingExprs": "viewDuration>10",
"limit":10
}

Endpoint

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

Headers

KeyValue
Acceptapplication/json, text/plain, /
Content-Typeapplication/json

Body

{
"timePeriod": {{timePeriod}},
"endTime": {{endTime}},
"datasource": "APP_NETWORK_DATA",
"metrics": [
"responseTime",
"successCount"
],
"dimensions": [
"timeStr",
"hostId"
],
"filters": [
{
"name": "mobileAppId",
"value": [
{{mobileAppId}}
],
"operator": "IN"
},
{
"name": "hostId",
"value": [
0
],
"operator": "!="
}
],
"top": {
"metric": "throughput",
"direction": "desc",
"dimensions": [
"hostId"
],
"limit": 5
},
"limit": -1,
"render": "object"
}

2. User experience (launch, page, action)

Data source name

APP_UX_DATA

Dimension

Indicator itemExpand the dimensionsMeaning
timeStr
moduleTypeData type
mobileBusinessIdmobileBusinessNameBusiness line
mobileAppIdmobileAppNameApplication
mobileAppVersionIdmobileAppVersionNameApplication version
manufacturerIdmanufacturerNameDevice
manufacturerModelIdmanufacturerModelNameDevice model
osIdosNameOperating system
osVersionIdosVersionNameOperating system version
channelIdchannelNameChannel
countryIdcountryNameCountry
regionIdregionNameProvince
cityIdcityNameCity
carrierIdcarrierNameCarrier
connectTypeIdconnectTypeNameConnect type
launchTypeLaunch type
actionTypeOperation type
actionIdactionNameOperation name
actionIdGetViewactionViewNamePage name
actionViewIdPage Name
viewTypePage type
viewIdviewNameView Name
viewCompositeIdviewCompositeNamePage name
countyIdcountyNameDistrict

Indicators

Indicator itemMeaning
launchCountlaunchCount
launchInitCountStartup initialization count
launchCreateCountStartup create count
launchLoadViewCountStartup page load count
launchSlowCountSlow startup count
abnormalLaunchCountAbnormal startup
launchCrashRateStartup crash rate
launchNetErrorRateStartup network error rate
launchHttpErrorRateStartup HTTP error rate
normalLaunchCountNormal startup count
launchCrashCountStartup crash count
launchRequestCountRequest count
launchRequestErrorCountStartup request error count
launchRequestHttpErrorCountStartup HTTP error count
launchRequestNetErrorCountStartup network error count
launchSlowPercentSlow initial startup percentage
launchStartupTimeAverage startup time
launchInitTimeAverage startup initialization time
launchCreateTimeAverage startup create time
launchLoadViewTimeAverage startup page load time
launchStartupTime50Startup time 50th percentile
launchStartupTime75Startup time 75th percentile
launchStartupTime95Startup time 95th percentile
launchStartupTime99Startup time 99th percentile
viewCountPage count
normalViewCountNormal page count
viewSlowInteractiveCountSlow interactive page count
viewSlowAppearCountSlow first screen page count
viewInteractiveTimeAverage interactive time
viewAppearTimeAverage first paint time
viewInteractiveTimeSumInteractive time
viewAppearTimeSumFirst screen time
slowInteractiveRateSlow interactive time percentage
slowAppearRateSlow first screen time percentage
viewInteractiveTime5050th Percentile Time to Interactive
viewInteractiveTime7575th Percentile Time to Interactive
viewInteractiveTime9595th Percentile Time to Interactive
viewInteractiveTime9999th Percentile Time to Interactive
viewAppearTime5050th Percentile First Screen Time
viewAppearTime7575th Percentile First Screen Time
viewAppearTime9595th Percentile First Screen Time
viewAppearTime9999th Percentile First Screen Time
viewInteractiveTimeHistogramDistribution of Page Interactive Times
viewAppearTimeHistogramDistribution of First Screen Times
actionCountOperation count
actionFluencyCountSmooth Operations Count
actionCrashCountCrash Operations Count
actionFailureCountFailure Operations Count
actionAnrCountANR Operations Count
actionSlowCountSlow Operations Count
actionFluencyErrorCountSmooth Operations Error Count
actionAnrErrorCountANR Operations Error Count
actionSlowErrorCountSlow Operations Error Count
actionAvailableCountUsable Operations Count
actionDurationTimeAverage Operation Time
actionBlockTimeAverage Operation Blocking Time
actionFluencyRateSmooth Operations Percentage
actionSlowRateSlow Operations Percentage
actionAnrRateANR Operations Percentage
actionCrashRateCrash Operations Percentage
actionFailureRateFailure Operations Percentage
actionaAvailabilityOperation Usability
actionDurationTimeHistogramDistribution of Operation Duration
actionBlockTimeHistogramDistribution of Blocking Duration
actionDurationTime5050th Percentile Operation Time
actionDurationTime7575th Percentile Operation Time
actionDurationTime9595th Percentile Operation Time
actionDurationTime9999th Percentile Operation Time

Endpoint

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

Headers

KeyValue
Acceptapplication/json, text/plain, /
Content-Typeapplication/json

Body

{
"timePeriod": {{timePeriod}},
"endTime": {{endTime}},
"datasource": "APP_UX_DATA",
"metrics": [
"launchStartupTime"
],
"dimensions": [

],
"filters": [
{
"name": "countryId",
"value": [
48
],
"groupType": "region"
},
{
"name": "mobileAppId",
"value": [
{{mobileAppId}}
],
"operator": "IN"
},
{
"name": "launchType",
"value": [
1
],
"operator": "IN"
},
{
"name": "moduleType",
"value": [
1
],
"operator": "="
}
],
"render": "list",
"orderByExprs": "launchStartupTime desc"
}

3. Network Request-Performance Metric

Data source name

APP_NETWORK_DATA

Explain: The extended dimension cannot be filtered or queried.

Dimension

Indicator itemExpand the dimensionsMeaning
timeStr
mobileAppIdmobileAppNameApplication
mobileAppVersionIdmobileAppVersionNameApplication version
mobileBusinessIdmobileBusinessNameBusiness line
manufacturerIdmanufacturerNameDevice
manufacturerModelIdmanufacturerModelNameDevice model
osIdosNameOperation system
osVersionIdosVersionNameOperation system version
countryIdcountryNameCountry
regionIdregionNameProvince
cityIdcityNameCity
carrierIdcarrierNameCarrier
connectTypeIdconnectTypeNameConnect type
hostIdhostNameDomain name
uriIduriNameRequest URL
errorTypeerrorTypeNameError type
errorCodeerrorCodeNameError code
cdnIdcdnNameCDN vendor
hostIpServer IP
hostCountryIdhostCountryNameServer country
hostRegionIdhostRegionNameServer province
hostCityIdhostCityNameServer city
hostCarrierIdhostCarrierNameServer carrier
bytesTypebytesTypeLabelPackage size
protocolTypeProtocol type
channelIdchannelNameChannel
hostIpTypehostIpTypeNameServer IP type
requestTyperequestTypeNameService type
launchTypeLaunch type
countyIdcountyNameDistrict
hostCountyIdhostCountyNameDistrict

Indicators

Indicator itemMeaning
requestCountRequest count
successCountSuccess request count
passCountNormal request count
slowCountSlow request count
slowRequestRateSlow request percentage
errorCountError count
httpErrorCountHTTP error count
networkErrorCountNetwork error count
dnsCountDNS count
tcpCountTCP count
sslCountSSL count
responseTimeTotalTotal response time
networkTimeTotalTotal network time
responseTimeAverage response time
dnsTimeAverage DNS time
connectTimeAverage TCP time
sslTimeAverage SSL time
firstPacketTimeAverage firstPacket time
remainPacketTimeAverage remainPacket time
localQueueTimeAverage localQueue time
networkTimeAverage network time
throughputThroughput Rate
networkSpeedTransmission Rate
networkTrafficSpeedNetwork Transmission Rate
totalTrafficConsumptionTotal Data Consumption
trafficConsumptionAverage Data Transfer
bytesSendbytesSend
bytesReceivedbytesReceived
httpErrorRateHTTP error rate
networkErrorRateNetwork error rate
requestErrorRateRequest error rate
pingSuccessCountping success count
pingTimeNetwork latency
packetLossRatePacket loss rate
reuseRateMultiplexing rate
availabilityAvailability

Endpoint

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

Headers

KeyValueDescription
Acceptapplication/json, text/plain, /
Content-Typeapplication/json

Body

{
"timePeriod": {{timePeriod}},
"endTime": {{endTime}},
"datasource": "APP_NETWORK_DATA",
"metrics": [
"responseTime",
"successCount"
],
"dimensions": [
"timeStr",
"hostId"
],
"filters": [
{
"name": "mobileAppId",
"value": [
{{mobileAppId}}
],
"operator": "IN"
},
{
"name": "hostId",
"value": [
0
],
"operator": "!="
}
],
"top": {
"metric": "throughput",
"direction": "desc",
"dimensions": [
"hostId"
],
"limit": 5
},
"limit": -1,
"render": "list"
}