add feature: threshold_count (fixes #1015)