add an option to limit history to last N samples for integrative compute