Exemple #1
0
def test_projects_mixed_buckets(store: RedisRealtimeMetricsStore,
                                redis_cluster: redis._RedisCluster) -> None:
    redis_cluster.set("symbolicate_event_low_priority:counter:10:42:111", 0)
    redis_cluster.set("symbolicate_event_low_priority:counter:5:53:111", 0)

    candidates = store.projects()
    assert list(candidates) == [42]
Exemple #2
0
def test_projects_one_histogram(store: RedisRealtimeMetricsStore,
                                redis_cluster: redis._RedisCluster) -> None:
    redis_cluster.hset("symbolicate_event_low_priority:duration:10:42:111:0",
                       0, 123)

    candidates = store.projects()
    assert list(candidates) == [42]
Exemple #3
0
def test_projects_negative_timestamp(
        store: RedisRealtimeMetricsStore,
        redis_cluster: redis._RedisCluster) -> None:
    redis_cluster.set("symbolicate_event_low_priority:counter:10:42:-111", 0)

    candidates = store.projects()
    assert list(candidates) == [42]
Exemple #4
0
def test_projects_multiple_metric_types(
        store: RedisRealtimeMetricsStore,
        redis_cluster: redis._RedisCluster) -> None:
    redis_cluster.set("symbolicate_event_low_priority:counter:10:42:111", 0)
    redis_cluster.hset("symbolicate_event_low_priority:duration:10:53:111:20",
                       20, 456)

    candidates = store.projects()
    assert list(candidates) == [42, 53]
Exemple #5
0
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) == []
Exemple #6
0
def test_projects_unset(store: RedisRealtimeMetricsStore) -> None:
    candidates = store.projects()
    assert list(candidates) == []