Open ahmad-elassuty opened 3 years ago
Thank you for this issue! I'll take a look for this issue on this weekend. Sorry for keeping you waiting. 🙇
Oh it's a bug. 💦 You are completely right. The sliding timewindow implementation of MongoDB adapter is similar to TumblingTimeWindow
but imperfect as you pointed.
SlidingTimeWindowInterface
from the adapterI'll work on this but it may take some time because I'm not familiar with MongoDB.
Thanks for this great package!
I'm a bit confused about MongoDB implementation. It is stated in the README that an adapter can support either SlidingTimeWindow or TumblingTimeWindow, however this is not the case for MongoDB adapter as far as I can tell from the implemented interfaces.
I believe MongoDB adapter does not support
SlidingTimeWindow
the same way Redis Adapter does. It rather resets the stats every whole time window (more like TumblingTimeWindow but without comparing to the previous window). I came to this conclusion after checking the adapter data model and the Rate strategy and I was wondering if that is by design or a bug?