react-native-ping icon indicating copy to clipboard operation
react-native-ping copied to clipboard

receivedNetworkSpeed and sendNetworkSpeed are always 0 b/s

Open Spyspyspy opened this issue 4 years ago • 7 comments

const myFn = async () => { let test = await Ping.getTrafficStats(); console.warn(test); }

So, I am doing like that, and speeds are always 0. For example:

{"receivedNetworkSpeed": "0B/s", "receivedNetworkTotal": "153.4MB", "sendNetworkSpeed": "0B/s", "sendNetworkTotal": "22.2MB"}

Spyspyspy avatar Aug 28 '20 11:08 Spyspyspy

It seems you are trying in simulator ?

prakashw3expert avatar Aug 28 '20 13:08 prakashw3expert

{"receivedNetworkSpeed": "1.0KB/s", "receivedNetworkTotal": "631.9MB", "sendNetworkSpeed": "4.0KB/s", "sendNetworkTotal": "179.3MB"}

Ok. But it is not real speed. What can i do wrong?

Spyspyspy avatar Aug 28 '20 13:08 Spyspyspy

const myFn = async () => { let test = await Ping.getTrafficStats(); console.warn(test); }

So, I am doing like that, and speeds are always 0. For example:

{"receivedNetworkSpeed": "0B/s", "receivedNetworkTotal": "153.4MB", "sendNetworkSpeed": "0B/s", "sendNetworkTotal": "22.2MB"}

Maybe you haven't done any network operations?

RoJoHub avatar Aug 31 '20 02:08 RoJoHub

So, I need to download something, and than check speed?

Spyspyspy avatar Aug 31 '20 04:08 Spyspyspy

So, I need to download something, and than check speed?

yes

RoJoHub avatar Aug 31 '20 04:08 RoJoHub

Okay. And what I need to do, to check upload speed?

Spyspyspy avatar Aug 31 '20 04:08 Spyspyspy

And I have a question. I need to download something big, and in this time immediately call getTrfficStats? What is the best approach?

Spyspyspy avatar Sep 02 '20 15:09 Spyspyspy