简体   繁体   English

如何衡量我的应用程序的数据使用情况?

[英]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意味着您有两个选项,

  1. The native implementation which depends on the OS you're working on. 本机实现取决于您正在使用的操作系统。

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

相关问题 如何在 react-native 中测量数据使用(互联网) - How to measure data usage (internet) in react-native React Native - 如何衡量ScrollView中的内容大小? - React Native - How to measure size of content in ScrollView? 如何使用 React Native 应用程序在 firebase 中添加数据? - How to add data in firebase with React Native app? 测量React Native应用程序中Web套接字使用的带宽 - Measure bandwidth used by web socket in React Native app 将 Fable 中的本机模块用于本机应用程序 - Usage of native modules in Fable for a react-native app 如何阻止我的用户在他们的手机上打开我的 React Native 应用程序,直到他们不会打开他们的 wifi 或移动数据? - How can I stop my user to open my React Native app on their phone until they will not turn on their wifi or mobile data? 如何将我的基于 javascript/React Native 的应用程序转换为 .ipa 进行部署? - How to turn my javascript/React Native based app into .ipa for deployment? 如何在 react-native 应用程序中将我的道具添加到堆栈屏幕 - How to add my props to the Stack Screens in the react-native app 如何确定我的 React Native 应用程序中的 inte.net 速度? - how can I determine internet speed in my react native app? 如何在 Iphone 上使用我的 React Native 应用程序? - How I can use my React Native app on Iphone?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM