Exemplo n.º 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]
Exemplo n.º 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]
Exemplo n.º 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]
Exemplo n.º 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]
Exemplo n.º 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) == []
Exemplo n.º 6
0
def test_projects_unset(store: RedisRealtimeMetricsStore) -> None:
    candidates = store.projects()
    assert list(candidates) == []