コード例 #1
0
def test_save_timing_stats():
    stats_db = create_stats_db()
    save_timing_stats(stats_db, 3, 1, 40, 80056356, 22, 159, 152)
    save_timing_stats(stats_db, 3, 2, 40, 80056356, 31, 185, 178)
    save_timing_stats(stats_db, 3, 3, 40, 80056356, 28, 178, 171)
    save_timing_stats(stats_db, 3, 4, 40, 80056356, 23, 182, 175)
    assert retrieve_timing_stats(stats_db) == [(3, 1, 40, 80056356, 22, 159, 152),
                                               (3, 2, 40, 80056356, 31, 185, 178),
                                               (3, 3, 40, 80056356, 28, 178, 171),
                                               (3, 4, 40, 80056356, 23, 182, 175)]
コード例 #2
0
def test_save_shard_stats():
    stats_db = create_stats_db()
    save_file_distribution(stats_db, 1, 40)
    save_file_distribution(stats_db, 2, 22)
    save_file_distribution(stats_db, 2, 18)
    save_file_distribution(stats_db, 3, 13)
    save_file_distribution(stats_db, 3, 12)
    save_file_distribution(stats_db, 3, 15)
    assert retrieve_file_distribution(stats_db) == [(1, 40),
                                                    (2, 22),
                                                    (2, 18),
                                                    (3, 13),
                                                    (3, 12),
                                                    (3, 15)]
コード例 #3
0
@pytest.fixture
def dockerpy_2_shards():
    return two_shards + ingest_balancer


@pytest.fixture
def dockerpy_3_shards():
    return three_shards + ingest_balancer


@pytest.fixture
def dockerpy_4_shards():
    return four_shards + ingest_balancer


stats_db = create_stats_db()


def test_1_shard(dockerpy_1_shard):
    wait_for_e2e_ingest_to_complete()
    save_values_for_graphs(stats_db, INGEST_THREADS, 1)


def test_2_shards(dockerpy_2_shards):
    wait_for_e2e_ingest_to_complete()
    save_values_for_graphs(stats_db, INGEST_THREADS, 2)


def test_3_shards(dockerpy_3_shards):
    wait_for_e2e_ingest_to_complete()
    save_values_for_graphs(stats_db, INGEST_THREADS, 3)