[英]How to measure the data usage of my app in react native?
I have a react-native app that I want to measure the data usage per user and gather them to optimize it later. 我有一个react-native应用程序,我想测量每个用户的数据使用情况并收集它们以便以后优化它。
I saw old questions for native android suggesting that trafficStats may give stats by UUID. 我看到了本机android的旧问题,建议trafficStats可以通过UUID给出统计数据。
What possibilities are there for react-native? 反应原生有什么可能性?
Using react-native means that you have two options, 使用react-native意味着您有两个选项,
The native implementation which depends on the OS you're working on. 本机实现取决于您正在使用的操作系统。
If you're using a JS library for networking (Axios) or even a builtin function (fetch) you can implement a wrapper Promise which calculates the length of any input/output string, + an approximation of the length of the header. 如果你正在使用JS库进行网络连接(Axios)甚至是内置函数(fetch),你可以实现一个包装器Promise,它计算任何输入/输出字符串的长度,+一个标头长度的近似值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.