Closed daviddias closed 7 years ago
I agree with using bignumbers for stats, I don't see any reason why we would want an option to disable them though.
On this note, to minimize polling, the stats object could be an event emitter, emitting an event when there is a change..
Also, regarding the counters (blocksReceived, dupBlocksReceived and dupDataReceived), I think we could have moving stats (1, 5 15 mins) - average and stddev. What do you say?
I believe that we should have a way for stats to be disabled and at the same time, make it so they are updated asynchronously, these are just shared values that are mutated with incrementations, which makes it very safe to defer.
Another things is to use a bignum library, otherwise it will get weird in long-running nodes.