Add clear_interval and flush_interval options for metrics filter

This can be useful if want to reset the counters in a given interval or specify the flush interval (5s by default)

The default behavior is not changed.