Skip to content

Commit 8145e27

Browse files
authored
Added system check benchmark (#80)
1 parent ad13808 commit 8145e27

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

benchmarks/query_benchmarks/queryset_filter_chain/benchmark.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@ def time_filter_chain(self):
1212
Book.objects.filter(title="Talent").filter(
1313
description__icontains="top performers"
1414
).filter(author_name__startswith="Geoff").filter(
15-
date_created__lt=datetime.datetime(year=2010, month=1, day=1)
15+
date_created__lt=datetime.datetime(
16+
year=2010, month=1, day=1, tzinfo=datetime.timezone.utc
17+
)
1618
).filter(
17-
date_created__gte=datetime.date(year=2007, month=1, day=1)
19+
date_created__gte=datetime.datetime(
20+
year=2007, month=1, day=1, tzinfo=datetime.timezone.utc
21+
)
1822
).filter(
19-
date_published=datetime.datetime.now()
23+
date_published=datetime.datetime.now(tz=datetime.timezone.utc)
2024
).filter(
2125
enabled=True
2226
)

benchmarks/system_check_benchmarks/__init__.py

Whitespace-only changes.

benchmarks/system_check_benchmarks/run_checks/__init__.py

Whitespace-only changes.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from django.core.checks import run_checks
2+
3+
from ...utils import bench_setup
4+
5+
6+
class SystemChecks:
7+
def setup(self):
8+
bench_setup(migrate=True)
9+
10+
def time_checks(self):
11+
run_checks(include_deployment_checks=True, databases=("default",))

0 commit comments

Comments
 (0)