'Count all samples within the specified period.'

def do_SampleCount(self):

    data = 0
    for d in self.watch_data:
        if (d.created_at < (self.now - self.timeperiod)):
            continue
        data = (data + 1)
    if self.do_data_cmp(data, float(self.rule['Threshold'])):
        return self.ALARM
    else:
        return self.NORMAL
