Solution
One of the solution for saving data with different rating is shown in teh snippet below:

You can simply eliminate data you don't need to save by calculating average of multiple samples, and save the result only. This helps with managing the memory on the disk.
The advantage of calculating average instead of saving one in 500 samples is that we don't receive unexpected peak in our measurement file.