错误分析
功能介绍
获取错误分析报告数据,包括表格详情数据与趋势数据,所获取数据与 https://mtj.baidu.com 中报告数据一致
接口
https://openapi.baidu.com/rest/2.0/mtj/svc/app/getDataByKey
此处仅列本接口特有参数,公共参数请参考报告级API说明
获取错误概况表格数据
参数名 | 参数类型 | 是否必须 | 描述 |
---|
method | string | 是 | visit/crash/a |
metrics | string | 是 | 指标列表,指标间逗号分隔 |
获取错误概况趋势数据
参数名 | 参数类型 | 是否必须 | 描述 |
---|
method | string | 是 | visit/crash/f |
metrics | string | 是 | 指标,只支持单个指标 |
获取错误概况汇总数据
参数名 | 参数类型 | 是否必须 | 描述 |
---|
method | string | 是 | visit/crash/sum |
metrics | string | 是 | 指标列表,指标间逗号分隔 |
获取错误概况详细数据
参数名 | 参数类型 | 是否必须 | 描述 |
---|
method | string | 是 | visit/crash/d |
errorTypeId | using bigint | 是 | 错误类型ID |
获取错误明细表格数据
参数名 | 参数类型 | 是否必须 | 描述 |
---|
method | string | 是 | visit/errortype/a |
errorTypeId | using bigint | 是 | 错误类型ID |
获取错误详情汇总数据
参数名 | 参数类型 | 是否必须 | 描述 |
---|
method | string | 是 | visit/errordetail/sum |
errorTypeId | using bigint | 是 | 错误类型ID |
errorId | using bigint | 是 | 错误ID |
获取错误详情趋势数据
参数名 | 参数类型 | 是否必须 | 描述 |
---|
method | string | 是 | visit/errordetail/f |
errorTypeId | using bigint | 是 | 错误类型ID |
errorId | using bigint | 是 | 错误ID |
filterGroup | string | 是 | 分组维度(机型:device,系统:os_version) |
指标
指标名 | 描述 | 适用接口 |
---|
error_count_per_day | 错误次数(日均) | visit/crash/a,visit/crash/f ,visit/error/sum |
error_ratio | 错误率 | visit/crash/a,visit/crash/f ,visit/crash/sum |
error_type_uv | 错误类型影响用户数(日均) | visit/crash/a |
error_type_uv_ratio | 影响用户占比 | visit/crash/a |
error_app_uv | 应用影响用户数 | visit/crash/f |
error_app_uv_per_day | 应用影响用户数(日均) | visit/crash/sum |
error_app_uv_ratio | 应用影响用户占比 | visit/crash/f,visit/crash/sum |
error_count | 错误次数 | visit/errortype/a,visit/errordetail/f |
error_uv | 错误影响用户数 | visit/errortype/a |
示例
获取错误分析数据
请求
https://openapi.baidu.com/rest/2.0/mtj/svc/app/getDataByKey?access_token=[ACCESS_TOKEN]&key=[APPKEY]&method=visit/error/a&start-date=20171107000000&end-date=20171108232359&metrics=error_count_per_day,error_ratio
响应
{
"status": 0,
"msg": "",
"data": {
"offset": 0,
"timeSpan": [
"2017/11/07 - 2017/11/08"
],
"fields": [
"visit_error_type_title",
"error_priority",
"error_count_per_day",
"error_ratio",
],
"total": 83,
"end": 0,
"sum": [
[
"--",
"--",
"--",
"--",
"--"
],
[]
],
"pageSum": [],
"items": [
[
[
{
"errorTypeId": "8856848205162120352",
"errorTypeName": "java.lang.RuntimeException"
}
],
[
{
"errorTypeId": "8891625662595069091",
"errorTypeName": "java.lang.OutOfMemoryError"
}
],
...
],
[
[
"高",
33497,
0.03
],
[
"高",
20755,
0.02
],
...
],
[],
[]
]
}
}
请求
https://openapi.baidu.com/rest/2.0/mtj/svc/app/getDataByKey?access_token=[ACCESS_TOKEN]&key=[APPKEY]&method=visit/errortype/a&start-date=20171107000000&end-date=20171108232359&metrics=error_count,error_uv&errotTypeId=8856848205162120352
响应
{
"status": 0,
"msg": "",
"data": {
"fields": [
"visit_error_abstract_title",
"error_count",
"error_uv"
],
"total": 755,
"items": [
[
[
{
"errorId": "6506791632066991872",
"errorAbstract": "java.lang.NoSuchMethodError: Lcom/android/org/bouncycastle/asn1/StreamUtil;. ",
"errorAbstractDetail": "\n\tat com.android.org.bouncycastle.asn1.ASN1InputStream.<init>(ASN1InputStream.java:29)\n\tat com.android.org.bouncycastle.asn1.ASN1InputStream.buildDEREncodableVector(ASN1InputStream.java:204)\n\tat com.android.org.bouncycastle.asn1.ASN1InputStream.buildObject(ASN1InputStream.java:173)\n\tat com.android.org.bouncycastle.asn1.ASN1InputStream.readObject(ASN1InputStream.java:272)\n\tat com.android.org.bouncycastle.jce.provider.CertPathValidatorUtilities.getAlgorithmIdentifier(CertPathValidatorUtilities.java:360)\n\tat com.android.org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi.engineValidate(PKIXCertPathValidatorSpi.java:236)\n\tat java.security.cert.CertPathValidator.validate(CertPathValidator.java:190)\n\tat org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:295)\n\tat org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:202)\n\tat org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.verifyCertificateChain(OpenSSLSocketImpl.java:595)\n\tat org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_do_handshake(Native Method)\n\tat org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:398)\n\tat libcore.net.http.HttpConnection.setupSecureSocket(HttpConnection.java:209)\n\tat libcore.net.http.HttpsURLConnectionImpl$HttpsEngine.makeSslConnection(HttpsURLConnectionImpl.java:478)\n\tat libcore.net.http.HttpsURLConnectionImpl$HttpsEngine.connect(HttpsURLConnectionImpl.java:433)\n\tat libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:290)\n\tat libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:240)\n\tat libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:81)\n\tat libcore.net.http.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:165)\n\tat com.baidu.mobstat.bt.b(Unknown Source)\n\tat com.baidu.mobstat.bt.a(Unknown Source)\n\tat com.baidu.mobstat.bt.c(Unknown Source)\n\tat com.baidu.mobstat.bt.a(Unknown Source)\n\tat com.baidu.mobstat.bx.run(Unknown Source)\n\tat android.os.Handler.handleCallback(Handler.java:730)\n\tat android.os.Handler.dispatchMessage(Handler.java:92)\n\tat android.os.Looper.loop(Looper.java:137)\n\tat android.os.HandlerThread.run(HandlerThread.java:61)"
}
],
[
{
"errorId": "1674227155938354414",
"errorAbstract": "java.lang.NoSuchMethodError: Ljava/lang/Character;.)rDgt ",
"errorAbstractDetail": "\tat org.ccil.cowan.tagsoup.Parser.makeName(Parser.java:1082)\n\tat org.ccil.cowan.tagsoup.Parser.gi(Parser.java:957)\n\tat org.ccil.cowan.tagsoup.HTMLScanner.scan(HTMLScanner.java:501)\n\tat org.ccil.cowan.tagsoup.Parser.parse(Parser.java:449)\n\tat android.text.HtmlToSpannedConverter.convert(Html.java:445)\n\tat android.text.Html.fromHtml(Html.java:139)\n\tat android.text.Html.fromHtml(Html.java:102)\n\tat com.baidu.appsearch.util.dg.a(Unknown Source)\n\tat com.baidu.appsearch.util.dg.a(Unknown Source)\n\tat com.baidu.appsearch.youhua.clean.usagenotification.UsageReceiver.g(Unknown Source)\n\tat com.baidu.appsearch.youhua.clean.usagenotification.UsageReceiver.c(Unknown Source)\n\tat com.baidu.appsearch.youhua.clean.usagenotification.UsageReceiver.onReceive(Unknown Source)\n\tat android.support.v4.content.LocalBroadcastManager.executePendingBroadcasts(Unknown Source)\n\tat android.support.v4.content.LocalBroadcastManager.access$000(Unknown Source)\n\tat android.support.v4.content.LocalBroadcastManager$1.handleMessage(Unknown Source)\n\tat android.os.Handler.dispatchMessage(Handler.java:102)\n\tat android.os.Looper.loop(Looper.java:136)\n\tat android.app.ActivityThread.main(ActivityThread.java:5017)\n\tat java.lang.reflect.Method.invokeNative(Native Method)\n\tat java.lang.reflect.Method.invoke(Method.java:515)\n\tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)\n\tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)\n\tat dalvik.system.NativeStart.main(Native Method)"
}
]
...
],
[
[
1198,
1
],
[
1131,
1
],
...
],
[],
[]
]
}
}
请求
https://openapi.baidu.com/rest/2.0/mtj/svc/app/getDataByKey?access_token=[ACCESS_TOKEN]&key=[APPKEY]&method=visit/errordetail/f&start-date=20171107000000&end-date=20171108232359&metrics=error_count&errotTypeId=8856848205162120352&errorId=15273843614266886315&filterGroup=device
响应
{
"status": 0,
"msg": "",
"data": {
"offset": 0,
"timeSpan": [
"2017/11/07 - 2017/11/08"
],
"fields": [
"simple_date_title",
"ipad (第五代)"
],
"total": 2,
"sum": [
[],
[]
],
"pageSum": [],
"items": [
[
[
"2017/11/07"
],
[
"2017/11/08"
]
],
[
[
1
],
[
"--"
]
],
[],
[]
]
}
}