jlouis / eministat

Port of Poul-Henning Kamp's ministat to the Erlang world
Other
99 stars 9 forks source link

Don't assume that the benchmark won't flush the message queue #6

Open frej opened 5 years ago

frej commented 5 years ago

eministat:s_warmup/1 schedules the sending of a 'warmup_over' message to self() to stop warmup after 3 seconds. If the benchmarked function flushes the message queue, the message can be lost and warmup go on indefinitely.

This patch changes s_warmup/1 to not rely on message sending, instead s_warmup/1 remembers when it started and terminates the warmup loop when 3s have elapsed.