add ring buffer implementation which is used to store the history data