I noticed that the Delay node in rate x msg / x unit time mode doesn't work as my intended.
For example, if set to 10 msg/10s it gives 1 msg/1s instead of 10 msg in 10s.
Another example, 5 msg/10s gives 1 msg/2s instead of a maximum of 5 messages every 10s.
I made a fix on my node-red with the corresponding test fixes.
This fix causes a change in the behavior of this node in rate mode with drop and without drop.
The difference is what happens if the messages come in bursts. So suppose (with 10msg/10 sec) that 5 messages arrive at time = 0, then another 5 at time = 9.9 seconds. Then the second five should (arguably) all be released immediately as there have been less than 10 messages in the last 10 seconds.
In the second image (my fix), I send many messages and they are processed every 10 seconds by 5 messages rate maximum.
5 at 16:37:56, and 5 at 16:38:06, etc
if I receive 100 messages, and I set the rate to 5 messages every 10 seconds, I just take 5 messages every 10 seconds and not 1 message every 2 seconds.
I don't know if this is clearer, or I may have misunderstood the purpose of this node in rate mode
Note that the node is behaving correctly according to the help text, where is says:
"When configured to rate limit messages, their delivery is spread across the configured time period."
That says that the 5 messages should be spread across the 10 seconds, so one every 2 seconds, which is what the node is doing.
So your mod would be a change, not a bug fix.
Ok thanks for your answer.
Is this change useful for you?
Can this modification be put in option of this node for example?
I'm using it and I thought it could be useful for other people
Thanks
I don't see any edit button to change the thread category to feature requests, you know how to do ?
or I have to create another ticket on thread feature request ?