added sampling in stats filter

In the accumulator it divides by sample and it defaults to 0.
This produces unexpected results.
Merge pull request #322 from mitadmin/stat_sampling_fix

added sampling in stats filter