Tests / apps/projects/tests.py
AnalyticsTest::test_overview
First seen 1 month, 1 week ago in 78a4357
CI
github-actions:test
15 runs
Average
19 ms
median 21 ms
max 23 ms
max 23 ms
Phases
Setup 0.63 ms
Call 18 ms
Teardown 0.14 ms
Categories
Database 18 ms
App code 0.06 ms
Other (Unsampled, pytest, Libraries, Deep copies) 0.97 ms
17 database queries per run
Needs 4 KB of memory (max 16 KB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, 2 weeks ago ·
open run
call18 ms96.6%
AnalyticsTest.test_overviewapps/projects/tests.py:758 overview = analytics_overview(resolve_scope(self.project))16 ms82.8%
overviewapps/projects/analytics.py:3038 ms41.4%
flaky_reportapps/projects/flakiness.py:2536 ms34.5%
compute_flaky_reportapps/projects/flakiness.py:2684 ms20.7%
failing_test_idsapps/projects/flakiness.py:202 ids = set(3 ms13.8%
QuerySet.__iter__django/db/models/query.py:3903 ms13.8%
QuerySet._fetch_alldjango/db/models/query.py:20003 ms13.8%
FlatValuesListIterable.__iter__django/db/models/query.py:2773 ms13.8%
SQLCompiler.results_iterdjango/db/models/sql/compiler.py:15733 ms13.8%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16111 ms6.9%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7951 ms6.9%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5781 ms6.9%
WhereNode.as_sqldjango/db/models/sql/where.py:1511 ms6.9%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5781 ms6.9%
WhereNode.as_sqldjango/db/models/sql/where.py:1511 ms6.9%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5781 ms6.9%
In.as_sqldjango/db/models/lookups.py:5561 ms6.9%
BuiltinLookup.as_sqldjango/db/models/lookups.py:2391 ms6.9%
In.process_rhsdjango/db/models/lookups.py:5401 ms6.9%
FieldGetDbPrepValueIterableMixin.batch_process_rhsdjango/db/models/lookups.py:3421 ms6.9%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16241 ms6.9%
CursorWrapper.executedjango/db/backends/utils.py:791 ms6.9%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms6.9%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms6.9%
Cursor.executepsycopg/cursor.py:1131 ms6.9%
Connection.waitpsycopg/connection.py:4951 ms6.9%
BaseCursor._execute_genpsycopg/_cursor_base.py:2061 ms6.9%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2861 ms6.9%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:781 ms6.9%
failing_test_idsapps/projects/flakiness.py:212 ids |= set(1 ms6.9%
QuerySet.__iter__django/db/models/query.py:3901 ms6.9%
QuerySet._fetch_alldjango/db/models/query.py:20001 ms6.9%
FlatValuesListIterable.__iter__django/db/models/query.py:2771 ms6.9%
SQLCompiler.results_iterdjango/db/models/sql/compiler.py:15731 ms6.9%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16241 ms6.9%
CursorWrapper.executedjango/db/backends/utils.py:791 ms6.9%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms6.9%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms6.9%
Cursor.executepsycopg/cursor.py:1131 ms6.9%
Connection.waitpsycopg/connection.py:4951 ms6.9%
BaseCursor._execute_genpsycopg/_cursor_base.py:2061 ms6.9%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2861 ms6.9%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:781 ms6.9%
compute_flaky_reportapps/projects/flakiness.py:2723 ms13.8%
observations_forapps/projects/flakiness.py:169 for row in Session.objects.filter(id__in={row[4] for row in test_runs}).values_list(1 ms6.9%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms6.9%
QuerySet.filterdjango/db/models/query.py:15421 ms6.9%
observations_forapps/projects/flakiness.py:189 for row in Profile.objects.filter(id__in={row[3] for row in perfs}).values_list(1 ms6.9%
QuerySet.__iter__django/db/models/query.py:3901 ms6.9%
QuerySet._fetch_alldjango/db/models/query.py:20001 ms6.9%
ValuesListIterable.__iter__django/db/models/query.py:2381 ms6.9%
SQLCompiler.results_iterdjango/db/models/sql/compiler.py:15731 ms6.9%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16111 ms6.9%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7671 ms6.9%
SQLCompiler.pre_sql_setupdjango/db/models/sql/compiler.py:881 ms6.9%
WhereNode.split_having_qualifydjango/db/models/sql/where.py:471 ms6.9%
flaky_reportapps/projects/flakiness.py:2501 ms6.9%
data_versionapps/projects/flakiness.py:229 profile = Profile.objects.filter(project=project).aggregate(latest=Max("date_processed"))["latest"]1 ms6.9%
QuerySet.aggregatedjango/db/models/query.py:5941 ms6.9%
Query.get_aggregationdjango/db/models/sql/query.py:6331 ms6.9%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16241 ms6.9%
CursorWrapper.executedjango/db/backends/utils.py:791 ms6.9%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms6.9%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms6.9%
Cursor.executepsycopg/cursor.py:1131 ms6.9%
Connection.waitpsycopg/connection.py:4951 ms6.9%
BaseCursor._execute_genpsycopg/_cursor_base.py:2061 ms6.9%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2861 ms6.9%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:781 ms6.9%
overviewapps/projects/analytics.py:3015 ms27.6%
latest_profilesapps/projects/analytics.py:264 profile = scope.profiles().filter(environment=environment).order_by("-started_at").first()4 ms20.7%
QuerySet.firstdjango/db/models/query.py:11453 ms13.8%
QuerySet.__iter__django/db/models/query.py:3903 ms13.8%
QuerySet._fetch_alldjango/db/models/query.py:20003 ms13.8%
ModelIterable.__iter__django/db/models/query.py:953 ms13.8%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16243 ms13.8%
CursorWrapper.executedjango/db/backends/utils.py:793 ms13.8%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms13.8%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms6.9%
Cursor.executepsycopg/cursor.py:1131 ms6.9%
Connection.waitpsycopg/connection.py:4951 ms6.9%
BaseCursor._execute_genpsycopg/_cursor_base.py:2061 ms6.9%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2861 ms6.9%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:781 ms6.9%
Scope.profilesapps/projects/analytics.py:175 return Profile.objects.filter(1 ms6.9%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms6.9%
QuerySet.filterdjango/db/models/query.py:15421 ms6.9%
QuerySet._filter_or_excludedjango/db/models/query.py:15601 ms6.9%
QuerySet._filter_or_exclude_inplacedjango/db/models/query.py:15701 ms6.9%
Query.add_qdjango/db/models/sql/query.py:16711 ms6.9%
Query._add_qdjango/db/models/sql/query.py:17031 ms6.9%
Query.build_filterdjango/db/models/sql/query.py:15731 ms6.9%
latest_profilesapps/projects/analytics.py:2631 ms6.9%
Scope.scoped_environmentsapps/projects/analytics.py:185 return list(Environment.objects.filter(project=self.project))1 ms6.9%
QuerySet.__iter__django/db/models/query.py:3901 ms6.9%
QuerySet._fetch_alldjango/db/models/query.py:20001 ms6.9%
ModelIterable.__iter__django/db/models/query.py:951 ms6.9%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16241 ms6.9%
CursorWrapper.executedjango/db/backends/utils.py:791 ms6.9%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms6.9%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms6.9%
Cursor.executepsycopg/cursor.py:1131 ms6.9%
Connection.waitpsycopg/connection.py:4951 ms6.9%
BaseCursor._execute_genpsycopg/_cursor_base.py:2061 ms6.9%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2861 ms6.9%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:781 ms6.9%
overviewapps/projects/analytics.py:2901 ms6.9%
Scope.profilesapps/projects/analytics.py:175 return Profile.objects.filter(1 ms6.9%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms6.9%
QuerySet.filterdjango/db/models/query.py:15421 ms6.9%
QuerySet._filter_or_excludedjango/db/models/query.py:15601 ms6.9%
QuerySet._filter_or_exclude_inplacedjango/db/models/query.py:15701 ms6.9%
Query.add_qdjango/db/models/sql/query.py:16711 ms6.9%
Query._add_qdjango/db/models/sql/query.py:17031 ms6.9%
Query.build_filterdjango/db/models/sql/query.py:15771 ms6.9%
Query.setup_joinsdjango/db/models/sql/query.py:19271 ms6.9%
overviewapps/projects/analytics.py:3021 ms6.9%
result_countsapps/projects/analytics.py:283 ).aggregate(total=Sum(F("tests_count") - F("skipped_count")), failed=Sum(F("failed_count") + F("error_count")))1 ms6.9%
QuerySet.aggregatedjango/db/models/query.py:5941 ms6.9%
Query.get_aggregationdjango/db/models/sql/query.py:6331 ms6.9%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16241 ms6.9%
CursorWrapper.executedjango/db/backends/utils.py:791 ms6.9%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms6.9%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms6.9%
Cursor.executepsycopg/cursor.py:1131 ms6.9%
Connection.waitpsycopg/connection.py:4951 ms6.9%
BaseCursor._execute_genpsycopg/_cursor_base.py:2061 ms6.9%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2861 ms6.9%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:781 ms6.9%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()3 ms13.8%
TestCase._fixture_teardowndjango/test/testcases.py:14953 ms13.8%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4833 ms13.8%
CursorWrapper.executedjango/db/backends/utils.py:793 ms13.8%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms13.8%
CursorWrapper._executedjango/db/backends/utils.py:1033 ms13.8%
Cursor.executepsycopg/cursor.py:1133 ms13.8%
Connection.waitpsycopg/connection.py:4953 ms13.8%
BaseCursor._execute_genpsycopg/_cursor_base.py:2063 ms13.8%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2863 ms13.8%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:783 ms13.8%
Estimated from 14 samples; phase durations are exact. Frames from pytest and pluggy are
hidden
.
Hot lines in your code
|
apps/projects/analytics.py:175
return Profile.objects.filter(
Scope.profiles
· Database
|
3 ms |
|
apps/projects/analytics.py:264
profile = scope.profiles().filter(environment=environment).order_by("-started_at").first()
latest_profiles
· Database
|
3 ms |
|
apps/projects/flakiness.py:202
ids = set(
failing_test_ids
· Database
|
3 ms |
|
apps/projects/analytics.py:185
return list(Environment.objects.filter(project=self.project))
Scope.scoped_environments
· Database
|
1 ms |
|
apps/projects/analytics.py:283
).aggregate(total=Sum(F("tests_count") - F("skipped_count")), failed=Sum(F("failed_count") + F("error_count")))
result_counts
· Database
|
1 ms |
|
apps/projects/flakiness.py:229
profile = Profile.objects.filter(project=project).aggregate(latest=Max("date_processed"))["latest"]
data_version
· Database
|
1 ms |
|
apps/projects/flakiness.py:212
ids |= set(
failing_test_ids
· Database
|
1 ms |
|
apps/projects/flakiness.py:169
for row in Session.objects.filter(id__in={row[4] for row in test_runs}).values_list(
observations_for
· Database
|
1 ms |
|
apps/projects/flakiness.py:189
for row in Profile.objects.filter(id__in={row[3] for row in perfs}).values_list(
observations_for
· Database
|
1 ms |
Fixtures
Exact setup time| _live_server_helper function | 0.05 ms |
| _dj_autoclear_mailbox function | 0.04 ms |
| _template_string_if_invalid_marker function | 0.03 ms |
| _django_db_marker function | 0.03 ms |
| _django_set_urlconf function | 0.02 ms |
| _django_clear_site_cache function | 0.02 ms |
| monkeypatch function | 0.02 ms |
Database
17 queries · 6 msNo repeated queries.
Biggest pieces of work
|
call test body
apps/projects/tests.py:758
|
16 ms |
|
call _post_teardown
django/test/testcases.py:1240
|
3 ms |
Reliability
15 results · 0 CI failures · 0 local failuresThis test hasn't failed recently.
History
Latest 15 results, oldest first in the strip| When | Environment | Outcome | Duration | |
|---|---|---|---|---|
| 2 weeks ago | CI github-actions:test | passed | 19 ms | Profile |
| 2 weeks, 4 days ago | CI github-actions:test | passed | 21 ms | Profile |
| 2 weeks, 6 days ago | CI github-actions:test | passed | 13 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 19 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 13 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 23 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 18 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 23 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 13 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 23 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 22 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 21 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 22 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 14 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 22 ms | Profile |