libp2p / observer-toolkit

🐣 [WIP] toolkit for building libp2p introspection widgets + a few useful out-of-the-box widgets
https://libp2p.io
MIT License
2 stars 2 forks source link

Avoid actual 0 in mock data randomisation #44

Closed AlanSl closed 4 years ago

AlanSl commented 4 years ago

While demonstrating web sockets data this morning, I got an unexpected Assertion failed error in the mock data script, from DataGauge.

Digging deeper it looks like this was caused by the <1 in a million chance of Math.random() returning actual 0 for the u value in the random normal distribution function.

We could carefully check that every function, now and in future, can handle an exact 0... but it's much less burden to simply stop random() from returning exact 0.

(also, what is it about Zoom's screen share feature that causes every rare, intermittent bug or edge case to happen?!)

ovhemert commented 4 years ago

LGTM