def test_frequency_rates(self): from sentry import tsdb end = timezone.now() start = end - timedelta(minutes=self.window) rate = tsdb.get_sums(model=tsdb.models.group, keys=[self.group_id], start=start, end=end)[self.group_id] if rate >= self.count: return False return True
def test_frequency_rates(self): from sentry import tsdb end = timezone.now() start = end - timedelta(minutes=self.window) rate = tsdb.get_sums( model=tsdb.models.group, keys=[self.group_id], start=start, end=end, )[self.group_id] if rate >= self.count: return False return True