From e72d1ec007480235baffc7f0e439213d55d45ed0 2016-07-20 11:08:30 From: Marcin Lulek Date: 2016-07-20 11:08:30 Subject: [PATCH] tasks: change sampling rates for something better suited for big amounts of data --- diff --git a/backend/src/appenlight/celery/tasks.py b/backend/src/appenlight/celery/tasks.py index f08a7f8..306eee9 100644 --- a/backend/src/appenlight/celery/tasks.py +++ b/backend/src/appenlight/celery/tasks.py @@ -53,15 +53,16 @@ from appenlight.lib.enums import ReportType log = get_task_logger(__name__) -sample_boundries = list(range(100, 10000, 100)) +sample_boundries = list(range(100, 1000, 100)) + \ + list(range(1000, 10000, 1000)) + \ + list(range(10000, 100000, 5000)) -def pick_sample(total_occurences, report_type=1): +def pick_sample(total_occurences, report_type=None): every = 1.0 position = bisect.bisect_left(sample_boundries, total_occurences) if position > 0: - # 404 - if report_type == 2: + if report_type == ReportType.not_found: divide = 10.0 else: divide = 100.0