错误分析

功能介绍

获取错误分析报告数据,包括表格详情数据与趋势数据,所获取数据与 https://mtj.baidu.com 中报告数据一致

接口

  1. https://openapi.baidu.com/rest/2.0/mtj/svc/app/getDataByKey

此处仅列本接口特有参数,公共参数请参考报告级API说明

获取错误概况表格数据

参数名参数类型是否必须描述
methodstringvisit/crash/a
metricsstring指标列表,指标间逗号分隔

获取错误概况趋势数据

参数名参数类型是否必须描述
methodstringvisit/crash/f
metricsstring指标,只支持单个指标

获取错误概况汇总数据

参数名参数类型是否必须描述
methodstringvisit/crash/sum
metricsstring指标列表,指标间逗号分隔

获取错误概况详细数据

参数名参数类型是否必须描述
methodstringvisit/crash/d
errorTypeIdusing bigint错误类型ID

获取错误明细表格数据

参数名参数类型是否必须描述
methodstringvisit/errortype/a
errorTypeIdusing bigint错误类型ID

获取错误详情汇总数据

参数名参数类型是否必须描述
methodstringvisit/errordetail/sum
errorTypeIdusing bigint错误类型ID
errorIdusing bigint错误ID

获取错误详情趋势数据

参数名参数类型是否必须描述
methodstringvisit/errordetail/f
errorTypeIdusing bigint错误类型ID
errorIdusing bigint错误ID
filterGroupstring分组维度(机型: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

示例

获取错误分析数据

请求

  1. 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

响应

  1. {
  2. "status": 0,
  3. "msg": "",
  4. "data": {
  5. "offset": 0,
  6. "timeSpan": [
  7. "2017/11/07 - 2017/11/08"
  8. ],
  9. "fields": [
  10. "visit_error_type_title",
  11. "error_priority",
  12. "error_count_per_day",
  13. "error_ratio",
  14. ],
  15. "total": 83,
  16. "end": 0,
  17. "sum": [
  18. [
  19. "--",
  20. "--",
  21. "--",
  22. "--",
  23. "--"
  24. ],
  25. []
  26. ],
  27. "pageSum": [],
  28. "items": [
  29. [
  30. [
  31. {
  32. "errorTypeId": "8856848205162120352",
  33. "errorTypeName": "java.lang.RuntimeException"
  34. }
  35. ],
  36. [
  37. {
  38. "errorTypeId": "8891625662595069091",
  39. "errorTypeName": "java.lang.OutOfMemoryError"
  40. }
  41. ],
  42. ...
  43. ],
  44. [
  45. [
  46. "高",
  47. 33497,
  48. 0.03
  49. ],
  50. [
  51. "高",
  52. 20755,
  53. 0.02
  54. ],
  55. ...
  56. ],
  57. [],
  58. []
  59. ]
  60. }
  61. }

请求

  1. 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

响应

  1. {
  2. "status": 0,
  3. "msg": "",
  4. "data": {
  5. "fields": [
  6. "visit_error_abstract_title",
  7. "error_count",
  8. "error_uv"
  9. ],
  10. "total": 755,
  11. "items": [
  12. [
  13. [
  14. {
  15. "errorId": "6506791632066991872",
  16. "errorAbstract": "java.lang.NoSuchMethodError: Lcom/android/org/bouncycastle/asn1/StreamUtil;. ",
  17. "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)"
  18. }
  19. ],
  20. [
  21. {
  22. "errorId": "1674227155938354414",
  23. "errorAbstract": "java.lang.NoSuchMethodError: Ljava/lang/Character;.)rDgt ",
  24. "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)"
  25. }
  26. ]
  27. ...
  28. ],
  29. [
  30. [
  31. 1198,
  32. 1
  33. ],
  34. [
  35. 1131,
  36. 1
  37. ],
  38. ...
  39. ],
  40. [],
  41. []
  42. ]
  43. }
  44. }

请求

  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

响应

  1. {
  2. "status": 0,
  3. "msg": "",
  4. "data": {
  5. "offset": 0,
  6. "timeSpan": [
  7. "2017/11/07 - 2017/11/08"
  8. ],
  9. "fields": [
  10. "simple_date_title",
  11. "ipad (第五代)"
  12. ],
  13. "total": 2,
  14. "sum": [
  15. [],
  16. []
  17. ],
  18. "pageSum": [],
  19. "items": [
  20. [
  21. [
  22. "2017/11/07"
  23. ],
  24. [
  25. "2017/11/08"
  26. ]
  27. ],
  28. [
  29. [
  30. 1
  31. ],
  32. [
  33. "--"
  34. ]
  35. ],
  36. [],
  37. []
  38. ]
  39. }
  40. }