Count values over a treshold and give alarm

Hi.
I would like to count values in the last minute that are over a givene treshold. If the counter exceed a given value then set an alarm.


For example in this graph I want to count the last values from 1 minute that are over 10. If for example 17 of the values are over 10, then give an alarm.