Small fix for CPU stats collection.
Add a test to ensure only two CPU stat samples are kept