def test_increment_project_event_counter_same_bucket( store: RedisRealtimeMetricsStore, redis_cluster: redis._RedisCluster) -> None: store.increment_project_event_counter(17, 1147) store.increment_project_event_counter(17, 1149) assert redis_cluster.get( "symbolicate_event_low_priority:counter:10:17:1140") == "2"
def test_increment_project_event_counter_simple( store: RedisRealtimeMetricsStore, redis_cluster: redis._RedisCluster) -> None: store.increment_project_event_counter(17, 1147) assert redis_cluster.get( "symbolicate_event_low_priority:counter:10:17:1140") == "1" time.sleep(0.5) assert redis_cluster.get( "symbolicate_event_low_priority:counter:10:17:1140") is None
def test_increment_project_event_counter_same_bucket( store: RedisRealtimeMetricsStore, redis_cluster: redis._RedisCluster) -> None: store.increment_project_event_counter(17, 1147) time.sleep(0.2) store.increment_project_event_counter(17, 1149) assert redis_cluster.get( "symbolicate_event_low_priority:counter:10:17:1140") == "2" time.sleep(0.3) # the second insert should have refreshed the ttl assert redis_cluster.get( "symbolicate_event_low_priority:counter:10:17:1140") == "2" time.sleep(0.2) # it should have expired by now assert redis_cluster.get( "symbolicate_event_low_priority:counter:10:17:1140") is None