add feature: threshold_count (fixes #1015)

I've run this for our use case, and it works nicely.