def test_sample_data_over_time_2():
    time = MockedTime()
    percentile = RollingPercentile(time, 60000, 12, 1000, True)
    previous_time = 0
    for time_millis, latency in sample_data_holder_2:
        time.increment(time_millis - previous_time)
        previous_time = time_millis
        percentile.add_value(latency)

    print('0.01', percentile.percentile(0.01))
    print('Median', percentile.percentile(50))
    print('90th', percentile.percentile(90))
    print('99th', percentile.percentile(99))
    print('99.5th', percentile.percentile(99.5))
    print('99.99', percentile.percentile(99.99))

    percentile50 = percentile.percentile(50)
    if percentile50 > 90 or percentile50 < 50:
        pytest.fail('We expect around 60-70 but got: {}'.format(percentile50))

    percentile99 = percentile.percentile(99)
    if percentile99 < 400:
        msg = 'We expect to see some high values over 400 but got: {}'
        pytest.fail(msg.format(percentile99))
dataset/ETHPy150Open wiliamsouza/hystrix-py/tests/test_rolling_percentile.py/test_sample_data_over_time_2/original