微信小程序 運(yùn)維中心·getPerformance

2020-07-31 14:07 更新

operation.getPerformance

本接口應(yīng)在服務(wù)器端調(diào)用,詳細(xì)說(shuō)明參見(jiàn)服務(wù)端API。

性能監(jiān)控

請(qǐng)求地址

POST https://api.weixin.qq.com/wxaapi/log/get_performance?access_token=ACCESS_TOKEN

請(qǐng)求參數(shù)

屬性類型默認(rèn)值必填說(shuō)明
access_tokenstring接口調(diào)用憑證
cost_time_typenumber可選值 1(啟動(dòng)總耗時(shí)), 2(下載耗時(shí)),3(初次渲染耗時(shí))
default_start_timenumber查詢開(kāi)始時(shí)間
default_end_timenumber查詢結(jié)束時(shí)間
devicestring系統(tǒng)平臺(tái),可選值 "@_all:"(全部),1(IOS), 2(android)
is_download_codestring是否下載代碼包,當(dāng) type 為 1 的時(shí)候才生效,可選值 "@_all:"(全部),1(是), 2(否)
scenestring訪問(wèn)來(lái)源,當(dāng) type 為 1 或者 2 的時(shí)候才生效,通過(guò) getSceneList 接口獲取
networktypestring網(wǎng)絡(luò)環(huán)境, 當(dāng) type 為 2 的時(shí)候才生效,可選值 "@_all:",wifi, 4g, 3g, 2g

請(qǐng)求示例

{
  "cost_time_type": 2,
  "default_start_time": 1572339403,
  "default_end_time": 1574931403,
  "device": "@_all",
  "networktype": "@_all",
  "scene": "@_all",
  "is_download_code": "@_all"
}

返回的 JSON 數(shù)據(jù)包

屬性類型說(shuō)明
errcodenumber錯(cuò)誤碼
errmsgstring錯(cuò)誤信息
default_time_datastring錯(cuò)誤查詢數(shù)據(jù)(json字符串,結(jié)構(gòu)如下所述的 strbody)
compare_time_datastring比較數(shù)據(jù)

strbody 的結(jié)構(gòu)

屬性類型說(shuō)明
ref_datestring日期
cost_time_typenumber意思同參數(shù)里面的 cost_time_type
cost_timenumber耗時(shí)(毫秒)

響應(yīng)示例

{
  "default_time_data": "{\"list\":[{\"ref_date\":\"20191029\",\"cost_time_type\":2,\"cost_time\":1533},{\"ref_date\":\"20191030\",\"cost_time_type\":2,\"cost_time\":1682}]}",
  "compare_time_data": "",
  "errcode": 0
}


以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)