title: Taro.reportMonitor(name, value)

sidebar_label: reportMonitor

Reports monitoring results of custom service data.

How to Use

Before using this API, you need to create a monitor event on the Mini Program admin console by selecting O&M Center > Performance Monitoring > Service Data Monitoring, and configure monitoring description and alarm types. Each monitor event corresponds to a unique monitoring ID. A developer can create up to 128 monitor events.

Reference

Type

  1. (name: string, value: number) => void

Parameters

Property Type Description
name string The monitoring ID, which is obtained after a data indicator is created on the Mini Program admin console.
value number Reported value. After values are processed, the sum of reported values per minute is displayed on the Mini Program admin console.

Sample Code

  1. Taro.reportMonitor('1', 1)

API Support

API WeChat Mini-Program H5 React Native
Taro.reportMonitor ✔️