# Path: django_performance_testing/timing.py
# class TimeCollector(BaseCollector):
# 
#     type_name = 'time'
# 
#     def __enter__(self):
#         self.start = time()
#         return self
# 
#     def get_results_to_send(self):
#         return [NameValueResult(name='total', value=time() - self.start)]
# 
#     @classmethod
#     def get_sample_results(cls):
#         return [0.01, 1.00, 3.2]


from datetime import timedelta
from django_performance_testing.timing import TimeCollector
from freezegun import freeze_time
from testapp.test_helpers import capture_result_collected
import pytest


@pytest.mark.parametrize('seconds', [10, 5, 0.04])
def test_captures_and_measures_elapsed_time(seconds):
    with capture_result_collected() as captured:
        with freeze_time('2016-09-22 15:57:01') as frozen_time:

# Path: django_performance_testing/timing.py
# class TimeCollector(BaseCollector):
# 
#     type_name = 'time'
# 
#     def __enter__(self):
#         self.start = time()
#         return self
# 
#     def get_results_to_send(self):
#         return [NameValueResult(name='total', value=time() - self.start)]
# 
#     @classmethod
#     def get_sample_results(cls):
#         return [0.01, 1.00, 3.2]


# Path: tests/testapp/tests/test_timer_collector.py
from datetime import timedelta
from django_performance_testing.timing import TimeCollector
from freezegun import freeze_time
from testapp.test_helpers import capture_result_collected
import pytest



@pytest.mark.parametrize('seconds', [10, 5, 0.04])
def test_captures_and_measures_elapsed_time(seconds):
    with capture_result_collected() as captured:
        with freeze_time('2016-09-22 15:57:01') as frozen_time:

            with TimeCollector():