I have seen this kind of thing before,
There was a piece of code that could answer certain 'questions' that came from another 'black box' piece of code. In the case it could not answer them, it would forward them to another piece of 'black box' code that was really slow.
So sometimes previously unseen new 'questions' would show up, and they would show up in a batch, like 100 of them in a row.
The programmer was happy with how the program was working, but wanted some way of maybe improving the software in the future, if possible new questions were discovered.
So, the solution was to log unknown questions, but as it turned out, there were 1000's of different ones.
The logs got to big, and there was no benefit of speeding these up, since they had no obvious answers.
But every once in a while, a batch of questions would show up that could be answered.
Since the logs were getting to big, and the logging was getting in the way of logging the real important things he got to this solution:
only log a random 5%, this will clean up the logs, whilst in the long run still showing what questions/answers could be added.
So, if an unknown event occurred, in a random amount of these cases, it would be logged.
I think this is similar to what you are seeing here.
if (!ok || Math.random() < 0.1)
(or something similar). – Oli Charlesworth May 30 at 10:01