Github link: https://github.com/tealtadpole/tt-wechat-report-performance
Tencent’s WeChat Mini Program has a very robust native performance report tool. But I can’t find any library/util functions that utilize this tool. So, I decided to make one for my own usage, and as well make a tutorial on how to implement it in your projects. You can start by download the code from my repository here. The code should run out of the box in the WeChat Devtool. Make sure you’re using the latest version of WeChat devtool.

About wx.reportPerformance
wx.reportPerformance function can send performance data from client’s device, which means the data provided will reflecting your actual mini program performance from your users/audiences point of view. Tencent also provides a user friendly back office interface to view the data. You can access this back office from your WeChat mini program back office admin page.
To begin using wx.reportPerformance, you need to enable this feature in the back office admin page via 开发管理 》 运维中心 》小程序测速. After you enabled this feature, you can start to create parameters that you want to measure. There are two types of performance that you can measure, 1) network performance or 2) device performance. Each parameter will have a four digit number as an ID. Network performance ID will start with ‘1‘, while device performance ID will start with ‘2‘. Here are my network performance settings that I use.
- ‘NAVIGATION_ONLAUNCH’: 2001,
- ‘NAVIGATION_NAVIGATE’: 2002
- ‘RENDER’: 2002
- ‘SCRIPT’: 2003,
- ‘NETWORK_APICALL’: 1004
After you configured it in the Mini Program back office, you can set the parameters in the performanceConfig.js file. The config file has cleanUrl and debug configuration. I will explain about it more later. Here is my performanceConfig.js file example:

After you configure the performance config, do some configurations in the app.js to enable the performance monitoring. I did this by calling the enablePerformanceMonitoring function in the app.onShow method, and disablePerformanceMonitoring function in the app.onHide method. Make sure to pass this argument when calling the function.

One last configuration that you need to do, is to measure your API calls, I did this by using some local variables in my global request function. The variables store time before and after API call. Then, pass the duration into the reportApiPerformance function.

Note that you need to pass the correct code for API performance. Here I use environment from the config file, you need to modify this accordingly. If you have configured your mini program appId, and you have access to your own mini program back office, you can navigate to mp.weixin.qq.com, and see your data. It should looked like this:

The report itself is quite complete, you can see the user’s client information, such as iOS/Android phone, or high/mid/low-end phone. While for API performance, you can view the geographical data based on user’s province. Which really depends on your API server location, server performance, and user’s internet connection speed. Personally I noticed that west part of China (such as Xinjiang or Tibet) has the slowest API performance compared with other regions. The data I got is pretty much similar to this article about China’s internet connection speed. Shanghai’s internet speed is ranked #1 in the article 🙂
nice one
%%
Also visit my blog post :: entrepreneur
%%
Here is my homepage; iowa auto accident
%%
Look into my homepage Walnut auto accident
%%
My blog post; lawyer car accident near Me
%%
My website :: New hyde park railroad injuries
%%
Feel free to visit my web site – nevada boat accident
%%
my blog post – real sexy doll
%%
Stop by my blog … Rockaway Boat Accident
%%
Check out my website: Charlotte Auto Accident Attorney
%%
Feel free to surf to my blog Best sex Machine
%%
Here is my web-site … Oro Valley injury
%%
Feel free to visit my web-site … visalia Motorcycle accident attorney
%%
My web page – Chicago Auto Accident Attorney
%%
Feel free to visit my web-site northville 18 wheeler accident (Lynn)
%%
my page fallon boat accident (Della)
%%
My web blog: lovesense Sex machine
%%
My webpage – long beach prescription drugs (https://Vimeo.com)
%%
Feel free to surf to my blog … Real Life Doll Sex
%%
my website … Rochester boat accident
%%
Here is my website; Palos Heights Auto Accident
%%
Feel free to surf to my homepage: roswell boat accident
%%
My web site white oak prescription drugs
%%
Also visit my homepage morganton Accident
%%
My site: Patterson 18 Wheeler Accident
%%
Also visit my web blog :: berkeley railroad injuries, Desiree,
%%
Here is my blog :: Crystal city Boat Accident
%%
my website: winnfield 18 wheeler Accident
%%
Feel free to surf to my web page Oconomowoc boat accident
%%
Here is my site :: real
%%
Look at my webpage … real dollsex (sockyard47.Doodlekit.com)
%%
Take a look at my site; League City Motorcycle Accident Lawyer
%%
My page oceanport Auto accident
%%
My website … Warr acres Cerebral palsy
Comprare patente di guida reale e registrata sul nostro sito web senza sostenere alcun esame o fare la prova pratica. tutto ciò di cui abbiamo bisogno sono i tuoi dati e verranno registrati nel sistema entro i prossimi otto giorni. Le patenti di guida devono seguire la stessa procedura di registrazione di quelle rilasciate nelle autoscuole
https://patentecomprata.com
lkw führerschein kaufen ohne prüfung österreich, motorrad führerschein kaufen , bus führerschein kosten österreich. führerschein online kaufen, auto c ohne prüfung köln, führerschein klasse b kaufen, deutschen registrierten führerschein kaufen berlin, österreich führerschein kaufen legal in deutschland, führerschein in deutschland kaufen, PKW führerschein kaufen österreich, deutschen führerschein legal kaufen in österreich, kaufe deutschen führerschein, eu-führerschein kaufen,wie viel kostet der führerschein in österreich. https://fuhrerscheinkaufenlegal.com/
%%
Look at my blog – truck accident Compensation In Warner robins
%%
Have a look at my web blog – San Marino Asbestos
%%
Here is my blog post desloge workers’ compensation
%%
Also visit my web-site :: Savoy Motorcycle Accident
%%
My site: santaquin boat accident
%%
Feel free to visit my web page: Are ghost immobiliser worth it
%%
Visit my blog post :: Las Cruces Medical Malpractice
%%
Feel free to visit my blog post :: Lovesense Machine
%%
Here is my web blog … Encinitas Prescription Drugs
%%
Here is my website: Las Cruces Birth Defect
%%
my site wichita falls Accident
%%
My blog post mcgregor car Accident claim