EDCD / EDDN

EDDN - Elite: Dangerous Data Network
https://eddn.edcd.io/
BSD 3-Clause "New" or "Revised" License
298 stars 59 forks source link

StatsCollector has been broken after v0.4 release #30

Closed jamesremuscat closed 9 years ago

jamesremuscat commented 9 years ago

Something's happened to the StatsCollector, and it no longer does what it should. The reported values for 1min are always zero.

Steps to reproduce:

Expected outcome: a string such as

{"inbound": {"1min": 1, "60min": 1, "5min": 1}, "uptime": 62, "version": "0.5", "invalid": {"1min": 1, "60min": 1, "5min": 1}}

Actual outcome:

{"inbound": {"1min": 0, "60min": 1, "5min": 1}, "uptime": 62, "version": "0.5", "invalid": {"1min": 0, "60min": 1, "5min": 1}}

Because of the heavy value people have placed on the stats pages, I'm blocking the 0.5 release on this issue.

This is a regression since v0.4.

Marginal commented 9 years ago

Cannot reproduce. With the current head (4438825) I correctly see: {"inbound": {"1min": 2, "60min": 2, "5min": 2}, "uptime": 63, "version": "0.5", "outbound": {"1min": 2, "60min": 2, "5min": 2}}

Marginal commented 9 years ago

Looking more carefully it appears that you tested with an invalid message. I can't reproduce the behaviour that you're seeing with invalid messages either: {"inbound": {"1min": 1, "60min": 1, "5min": 1}, "uptime": 62, "version": "0.5", "invalid": {"1min": 1, "60min": 1, "5min": 1}}

AnthorNet commented 9 years ago

Just tested on test gateway and can't reproduce it either.

jamesremuscat commented 9 years ago

Seems to be fairly reliably reproduceable on my home dev box plus my continuous-integration server, but not on my work dev box.

Just to check my sanity, could you run the test I committed above, and let me know that it passes?

jamesremuscat commented 9 years ago

Looks like there's something wonky going on with the call to sleep(60), so in some circumstances updates are triggered more than once. I'm investigating.

AnthorNet commented 9 years ago

Can you told me how you run the tests ? Didn't remember ^^

But be aware that Sleep is not always precise depending on OS and tick.

jamesremuscat commented 9 years ago

nosetests --with-xunit --with-xcoverage --cover-package=eddn --cover-erase --cover-inclusive

I've tried rewriting the method to compare to actual runtime, but the loop still gets triggered multiple times. This is baffling myself and my colleagues!

AnthorNet commented 9 years ago

Odd ! Might have come with the python update? No?

Anyway, well played^^

Marginal commented 9 years ago

So, do you fancy doing the postponed deployment tonight?