gather data over time, write to file