flush buffers when sampling stops