Alerting after few occurrences only

I am creating an alert where my requirement is to send an alert only if the error is found greater than 15 times. So is there any way that monitor watches for few minutes and the error occurs more frequently in last five minutes then alert?

EX: 1. If the CPU of system reaches 90 immediately it sends alert instead it should wait for some more time and then alert if CPU stands more than 90.(Watcher kind of thing)

  1. I have error called “No Document found”, it is known error and I wanted to send these alert only if this occurs more than 15 times in previous 5 minutes.