def test_get_durations_for_project_empty( store: RedisRealtimeMetricsStore, redis_cluster: redis._RedisCluster, ) -> None: redis_cluster.hset( "symbolicate_event_low_priority:duration:10:42:111", 0, 123, ) redis_cluster.delete("symbolicate_event_low_priority:duration:10:42:111") durations = store.get_durations_for_project(42, 113) assert list(durations) == [ DurationHistogram(timestamp=110, histogram=BucketedDurations(empty_histogram())) ] store._duration_time_window = 20 durations = store.get_durations_for_project(42, 113) assert list(durations) == [ DurationHistogram(timestamp=90, histogram=BucketedDurations(empty_histogram())), DurationHistogram(timestamp=100, histogram=BucketedDurations(empty_histogram())), DurationHistogram(timestamp=110, histogram=BucketedDurations(empty_histogram())), ]
def test_projects_empty(store: RedisRealtimeMetricsStore, redis_cluster: redis._RedisCluster) -> None: redis_cluster.set( "symbolicate_event_low_priority:counter:10:42:111", 0, ) redis_cluster.delete("symbolicate_event_low_priority:counter:10:42:111") candidates = store.projects() assert list(candidates) == []
def test_get_counts_for_project_empty( store: RedisRealtimeMetricsStore, redis_cluster: redis._RedisCluster) -> None: redis_cluster.set( "symbolicate_event_low_priority:counter:10:42:111", 0, ) redis_cluster.delete("symbolicate_event_low_priority:counter:10:42:111") counts = store.get_counts_for_project(42) assert list(counts) == []
def test_get_counts_for_project_empty( store: RedisRealtimeMetricsStore, redis_cluster: redis._RedisCluster) -> None: redis_cluster.set( "symbolicate_event_low_priority:counter:10:42:111", 0, ) redis_cluster.delete("symbolicate_event_low_priority:counter:10:42:111") counts = store.get_counts_for_project(42, 113) assert list(counts) == [BucketedCount(timestamp=110, count=0)] store._counter_time_window = 20 counts = store.get_counts_for_project(42, 113) assert list(counts) == [ BucketedCount(timestamp=90, count=0), BucketedCount(timestamp=100, count=0), BucketedCount(timestamp=110, count=0), ]