Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

I saw old questions for native android suggesting that trafficStats may give stats by UUID.

What possibilities are there for react-native?

like image 214
Assem Avatar asked Aug 08 '17 15:08

Assem


People also ask

What are some good ways to performance test in React Native?

How to measure performance in React Native apps | New Relic. Put all over the place in its place—monitor your entire stack on a single platform. Get more value from your data with hundreds of quickstarts that integrate with just about anything. Be up and running in minutes.

Where does React Native app store data?

On iOS, the main storage library for React Native is based on the Apple File System, using FileManager to read and store files on the device unencrypted. On Android, AsyncStorage uses either the key-value store RocksDB or SQLite, based on which one is available.


1 Answers

Using react-native means that you have two options,

  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.

like image 116
Tenma Kenzo Avatar answered Oct 06 '22 16:10

Tenma Kenzo