Implement an efficient solution using the sliding window pattern to compute rolling performance metrics on real-time data streams.
Given an ordered list of numeric measurements and a positive window size, return the average of every complete consecutive window in order. The function must avoid recomputing each window from scratch.
Signature: def rolling_average(measurements, window_size). Return a list of floating-point averages. For example, [2, 4, 6, 8] with window 2 returns [3.0, 5.0, 7.0].
def rolling_average(measurements, window_size):