Queue peek to more than 1 data

Aha, now I understand it better. You mean like calculating a running average? I once wrote a template class like this in C++. It would fill up, and when full, it would overwrite the oldest samples.

Also it would keep a running sum of data: when X is added and Y is overwritten, the sum would be updated accordingly:
sum = sum - Y + X.

If it is that simple, I would not look at a queue or a circular buffer.