Skip to content
This repository has been archived by the owner on Aug 23, 2019. It is now read-only.

stats - stat - prevent 0ms timeDiff breaking movingAverage #336

Merged
merged 2 commits into from
Apr 25, 2019

Conversation

kumavis
Copy link
Contributor

@kumavis kumavis commented Apr 25, 2019

Fixes https://github.com/libp2p/js-libp2p-switch/issues/335

This is a work around, and will still cause an inaccurate movingAverage when pushing in data immediately after creation, but movingAverage will "heal" over time

a more correct solution might be not pushing in the initial zero and first waiting for 2 samples

@ghost ghost assigned kumavis Apr 25, 2019
@ghost ghost added the in progress label Apr 25, 2019
@ghost ghost assigned jacobheun Apr 25, 2019
@jacobheun jacobheun merged commit 7aebb9c into master Apr 25, 2019
@ghost ghost removed the in progress label Apr 25, 2019
@jacobheun jacobheun deleted the stats-infinity-hz branch April 25, 2019 19:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stats - possible to get a NaN
2 participants