Tests / apps/api/tests.py
IngestEnvironmentTest::test_same_environment_is_reused
First seen 1 month, 1 week ago in 78a4357
CI
github-actions:test
15 runs
Average
66 ms
median 73 ms
max 104 ms
max 104 ms
Phases
Setup 0.65 ms
Call 64 ms
Teardown 2 ms
Categories
Database 42 ms
App code 0.19 ms
Test code 0.11 ms
Other (Libraries, Unsampled, pytest, Deep copies) 23 ms
61 database queries per run
Needs 17 KB of memory (max 192 KB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, 2 weeks ago ·
open run
call52 ms98.1%
IngestEnvironmentTest.test_same_environment_is_reusedapps/api/tests.py:389 first = self.ingest_start({"environment": environment})34 ms64.3%
IngestEnvironmentTest.ingest_startapps/api/tests.py:352 response = self.client.post(34 ms64.3%
Client.postdjango/test/client.py:115334 ms64.3%
RequestFactory.postdjango/test/client.py:49934 ms64.3%
RequestFactory.genericdjango/test/client.py:67134 ms64.3%
Client.requestdjango/test/client.py:108234 ms64.3%
ClientHandler.__call__django/test/client.py:18618 ms33.8%
BaseHandler.get_responsedjango/core/handlers/base.py:14118 ms33.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms33.8%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:13018 ms33.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms33.8%
MiddlewareMixin.__call__django/utils/deprecation.py:30918 ms33.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms33.8%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:12318 ms33.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms33.8%
MiddlewareMixin.__call__django/utils/deprecation.py:30918 ms33.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms33.8%
MiddlewareMixin.__call__django/utils/deprecation.py:30918 ms33.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms33.8%
MiddlewareMixin.__call__django/utils/deprecation.py:30918 ms33.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms33.8%
MiddlewareMixin.__call__django/utils/deprecation.py:30918 ms33.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms33.8%
MiddlewareMixin.__call__django/utils/deprecation.py:30918 ms33.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms33.8%
MiddlewareMixin.__call__django/utils/deprecation.py:30918 ms33.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms33.8%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:3418 ms33.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms33.8%
BaseHandler._get_responsedjango/core/handlers/base.py:19818 ms33.8%
csrf_exempt.<locals>._view_wrapperdjango/views/decorators/csrf.py:6518 ms33.8%
jsonify_errors.<locals>.wrapped_viewapps/api/urls.py:3718 ms33.8%
require_http_methods.<locals>.decorator.<locals>.innerdjango/views/decorators/http.py:6418 ms33.8%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:75 return view_func(request, *args, **kwargs)12 ms23.7%
ingest_startapps/api/urls.py:100 process_ingest_start(ingest.id)11 ms20.3%
_SharedTaskProxy.__call__potatoq/app.py:76311 ms20.3%
Task.__call__potatoq/task.py:18911 ms20.3%
process_ingest_startapps/api/tasks.py:774 ms6.8%
get_or_create_numberedapps/projects/models.py:212 ms3.4%
next_numberapps/projects/models.py:35 return (model.objects.filter(project_id=project_id).aggregate(last=models.Max("number"))["last"] or 0) + 12 ms3.4%
get_or_create_numberedapps/projects/models.py:24 return model.objects.create(project=project, number=number, **lookup, **(defaults or {})), True2 ms3.4%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms3.4%
QuerySet.createdjango/db/models/query.py:6692 ms3.4%
Run.saveapps/projects/models.py:188 super().save(*args, **kwargs)2 ms3.4%
Model.savedjango/db/models/base.py:8742 ms3.4%
Model.save_basedjango/db/models/base.py:9662 ms3.4%
Model._save_tabledjango/db/models/base.py:11672 ms3.4%
Model._do_insertdjango/db/models/base.py:12182 ms3.4%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms3.4%
QuerySet._insertdjango/db/models/query.py:19182 ms3.4%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19252 ms3.4%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.4%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.4%
Cursor.executepsycopg/cursor.py:1132 ms3.4%
Connection.waitpsycopg/connection.py:4952 ms3.4%
process_ingest_startapps/api/tasks.py:53 ingest = Ingest.objects.only("id").select_for_update().get(id=ingest_id)2 ms3.4%
QuerySet.getdjango/db/models/query.py:6252 ms3.4%
QuerySet.filterdjango/db/models/query.py:15422 ms3.4%
QuerySet._filter_or_excludedjango/db/models/query.py:15602 ms3.4%
QuerySet._filter_or_exclude_inplacedjango/db/models/query.py:15702 ms3.4%
Query.add_qdjango/db/models/sql/query.py:16712 ms3.4%
Query._add_qdjango/db/models/sql/query.py:17032 ms3.4%
Query.build_filterdjango/db/models/sql/query.py:16132 ms3.4%
Query.build_lookupdjango/db/models/sql/query.py:14402 ms3.4%
process_ingest_startapps/api/tasks.py:79 ingest.project,2 ms3.4%
ForwardManyToOneDescriptor.__get__django/db/models/fields/related_descriptors.py:2442 ms3.4%
ForeignObject.get_local_related_valuedjango/db/models/fields/related.py:8122 ms3.4%
ForeignObject.get_instance_value_for_fieldsdjango/db/models/fields/related.py:8342 ms3.4%
DeferredAttribute.__get__django/db/models/query_utils.py:2712 ms3.4%
Model.refresh_from_dbdjango/db/models/base.py:7432 ms3.4%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms3.4%
process_ingest_startapps/api/tasks.py:842 ms3.4%
get_or_create_environmentapps/projects/environments.py:63 obj, created = Environment.objects.get_or_create(2 ms3.4%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms3.4%
QuerySet.get_or_createdjango/db/models/query.py:9872 ms3.4%
QuerySet.getdjango/db/models/query.py:6352 ms3.4%
QuerySet.__len__django/db/models/query.py:3722 ms3.4%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms3.4%
ModelIterable.__iter__django/db/models/query.py:952 ms3.4%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms3.4%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.4%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.4%
Cursor.executepsycopg/cursor.py:1132 ms3.4%
Connection.waitpsycopg/connection.py:4952 ms3.4%
ingest_startapps/api/urls.py:91 muted_tests = Test.objects.filter(project=project, mute__date_unmuted__isnull=True, mute__until__gte=timezone.now())2 ms3.4%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms3.4%
QuerySet.filterdjango/db/models/query.py:15422 ms3.4%
QuerySet._filter_or_excludedjango/db/models/query.py:15602 ms3.4%
QuerySet._filter_or_exclude_inplacedjango/db/models/query.py:15702 ms3.4%
Query.add_qdjango/db/models/sql/query.py:16712 ms3.4%
Query._add_qdjango/db/models/sql/query.py:17032 ms3.4%
Query.build_filterdjango/db/models/sql/query.py:16132 ms3.4%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:73 touch_token(request.headers.get("Authorization"))4 ms6.8%
touch_tokenapps/api/urls.py:57 .values_list("pk", flat=True)2 ms3.4%
QuerySet.values_listdjango/db/models/query.py:14582 ms3.4%
QuerySet._valuesdjango/db/models/query.py:14092 ms3.4%
Query.set_valuesdjango/db/models/sql/query.py:25482 ms3.4%
touch_tokenapps/api/urls.py:59 SecretTokens.objects.filter(pk__in=list(stale)).update(date_last_used=now)2 ms3.4%
QuerySet.updatedjango/db/models/query.py:13002 ms3.4%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21112 ms3.4%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms3.4%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.4%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:72 project = get_object_or_404(Project, secrettokens__token=request.headers.get("Authorization"))2 ms3.4%
get_object_or_404django/shortcuts.py:902 ms3.4%
QuerySet.getdjango/db/models/query.py:6352 ms3.4%
QuerySet.__len__django/db/models/query.py:3722 ms3.4%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms3.4%
ModelIterable.__iter__django/db/models/query.py:952 ms3.4%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms3.4%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.4%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.4%
Cursor.executepsycopg/cursor.py:1132 ms3.4%
Connection.waitpsycopg/connection.py:4952 ms3.4%
ClientHandler.__call__django/test/client.py:17314 ms27.1%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6214 ms27.1%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10414 ms27.1%
WhiteNoise.add_fileswhitenoise/base.py:10814 ms27.1%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12011 ms20.3%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13111 ms20.3%
WhiteNoise.get_static_filewhitenoise/base.py:2087 ms13.5%
StaticFile.__init__whitenoise/responders.py:732 ms3.4%
StaticFile.get_headerswhitenoise/responders.py:1762 ms3.4%
StaticFile.__init__whitenoise/responders.py:762 ms3.4%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1882 ms3.4%
StaticFile.__init__whitenoise/responders.py:772 ms3.4%
StaticFile.get_alternativeswhitenoise/responders.py:2002 ms3.4%
WhiteNoise.get_static_filewhitenoise/base.py:2022 ms3.4%
WhiteNoise.add_mime_headerswhitenoise/base.py:2212 ms3.4%
Headers.add_header<stdlib>/wsgiref/headers.py:1842 ms3.4%
WhiteNoise.get_static_filewhitenoise/base.py:2032 ms3.4%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1154 ms6.8%
scantreewhitenoise/base.py:2624 ms6.8%
scantreewhitenoise/base.py:2622 ms3.4%
scantreewhitenoise/base.py:2622 ms3.4%
scantreewhitenoise/base.py:2622 ms3.4%
scantreewhitenoise/base.py:2642 ms3.4%
ClientHandler.__call__django/test/client.py:1782 ms3.4%
__init____init__:-12 ms3.4%
WSGIRequest.__init__django/core/handlers/wsgi.py:732 ms3.4%
IngestEnvironmentTest.test_same_environment_is_reusedapps/api/tests.py:39016 ms30.4%
IngestEnvironmentTest.ingest_startapps/api/tests.py:352 response = self.client.post(16 ms30.4%
Client.postdjango/test/client.py:115316 ms30.4%
RequestFactory.postdjango/test/client.py:49916 ms30.4%
RequestFactory.genericdjango/test/client.py:67116 ms30.4%
Client.requestdjango/test/client.py:108216 ms30.4%
ClientHandler.__call__django/test/client.py:18616 ms30.4%
BaseHandler.get_responsedjango/core/handlers/base.py:14116 ms30.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5516 ms30.4%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:13016 ms30.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5516 ms30.4%
MiddlewareMixin.__call__django/utils/deprecation.py:30916 ms30.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5516 ms30.4%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:12316 ms30.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5516 ms30.4%
MiddlewareMixin.__call__django/utils/deprecation.py:30916 ms30.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5516 ms30.4%
MiddlewareMixin.__call__django/utils/deprecation.py:30916 ms30.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5516 ms30.4%
MiddlewareMixin.__call__django/utils/deprecation.py:30916 ms30.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5516 ms30.4%
MiddlewareMixin.__call__django/utils/deprecation.py:30916 ms30.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5516 ms30.4%
MiddlewareMixin.__call__django/utils/deprecation.py:30916 ms30.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5516 ms30.4%
MiddlewareMixin.__call__django/utils/deprecation.py:30916 ms30.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5516 ms30.4%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:3416 ms30.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5516 ms30.4%
BaseHandler._get_responsedjango/core/handlers/base.py:19816 ms30.4%
csrf_exempt.<locals>._view_wrapperdjango/views/decorators/csrf.py:6516 ms30.4%
jsonify_errors.<locals>.wrapped_viewapps/api/urls.py:3716 ms30.4%
require_http_methods.<locals>.decorator.<locals>.innerdjango/views/decorators/http.py:6416 ms30.4%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:75 return view_func(request, *args, **kwargs)14 ms27.1%
ingest_startapps/api/urls.py:100 process_ingest_start(ingest.id)12 ms23.7%
_SharedTaskProxy.__call__potatoq/app.py:76312 ms23.7%
Task.__call__potatoq/task.py:18912 ms23.7%
process_ingest_startapps/api/tasks.py:844 ms6.8%
get_or_create_environmentapps/projects/environments.py:63 obj, created = Environment.objects.get_or_create(2 ms3.4%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms3.4%
QuerySet.get_or_createdjango/db/models/query.py:9872 ms3.4%
QuerySet.getdjango/db/models/query.py:6252 ms3.4%
QuerySet.filterdjango/db/models/query.py:15422 ms3.4%
QuerySet._filter_or_excludedjango/db/models/query.py:15602 ms3.4%
QuerySet._filter_or_exclude_inplacedjango/db/models/query.py:15702 ms3.4%
Query.add_qdjango/db/models/sql/query.py:16712 ms3.4%
Query._add_qdjango/db/models/sql/query.py:17032 ms3.4%
Query.build_filterdjango/db/models/sql/query.py:15772 ms3.4%
Query.setup_joinsdjango/db/models/sql/query.py:19732 ms3.4%
get_or_create_environmentapps/projects/environments.py:79 obj.save(update_fields=update_fields)2 ms3.4%
Model.savedjango/db/models/base.py:8742 ms3.4%
Model.save_basedjango/db/models/base.py:9662 ms3.4%
Model._save_tabledjango/db/models/base.py:11102 ms3.4%
Model._do_updatedjango/db/models/base.py:12112 ms3.4%
QuerySet._updatedjango/db/models/query.py:13272 ms3.4%
SQLUpdateCompiler.execute_returning_sqldjango/db/models/sql/compiler.py:21402 ms3.4%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21112 ms3.4%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms3.4%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.4%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.4%
Cursor.executepsycopg/cursor.py:1132 ms3.4%
Connection.waitpsycopg/connection.py:4952 ms3.4%
process_ingest_startapps/api/tasks.py:53 ingest = Ingest.objects.only("id").select_for_update().get(id=ingest_id)2 ms3.4%
QuerySet.getdjango/db/models/query.py:6352 ms3.4%
QuerySet.__len__django/db/models/query.py:3722 ms3.4%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms3.4%
ModelIterable.__iter__django/db/models/query.py:952 ms3.4%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms3.4%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.4%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.4%
Cursor.executepsycopg/cursor.py:1132 ms3.4%
Connection.waitpsycopg/connection.py:4952 ms3.4%
process_ingest_startapps/api/tasks.py:79 ingest.project,2 ms3.4%
ForwardManyToOneDescriptor.__get__django/db/models/fields/related_descriptors.py:2442 ms3.4%
ForeignObject.get_local_related_valuedjango/db/models/fields/related.py:8122 ms3.4%
ForeignObject.get_instance_value_for_fieldsdjango/db/models/fields/related.py:8342 ms3.4%
DeferredAttribute.__get__django/db/models/query_utils.py:2712 ms3.4%
Model.refresh_from_dbdjango/db/models/base.py:7582 ms3.4%
QuerySet.getdjango/db/models/query.py:6352 ms3.4%
QuerySet.__len__django/db/models/query.py:3722 ms3.4%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms3.4%
ModelIterable.__iter__django/db/models/query.py:952 ms3.4%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms3.4%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.4%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.4%
Cursor.executepsycopg/cursor.py:1132 ms3.4%
Connection.waitpsycopg/connection.py:4952 ms3.4%
process_ingest_startapps/api/tasks.py:772 ms3.4%
get_or_create_numberedapps/projects/models.py:212 ms3.4%
next_numberapps/projects/models.py:35 return (model.objects.filter(project_id=project_id).aggregate(last=models.Max("number"))["last"] or 0) + 12 ms3.4%
QuerySet.aggregatedjango/db/models/query.py:5942 ms3.4%
Query.get_aggregationdjango/db/models/sql/query.py:6332 ms3.4%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms3.4%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.4%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.4%
Cursor.executepsycopg/cursor.py:1132 ms3.4%
Connection.waitpsycopg/connection.py:4952 ms3.4%
process_ingest_startapps/api/tasks.py:89 Session.objects.get_or_create(2 ms3.4%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms3.4%
QuerySet.get_or_createdjango/db/models/query.py:9922 ms3.4%
Atomic.__enter__django/db/transaction.py:2112 ms3.4%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms3.4%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:4002 ms3.4%
BaseDatabaseWrapper._savepointdjango/db/backends/base/base.py:3672 ms3.4%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.4%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms3.4%
Cursor.executepsycopg/cursor.py:1132 ms3.4%
Connection.waitpsycopg/connection.py:4952 ms3.4%
process_ingest_startapps/api/tasks.py:105 ingest.save(update_fields=["date_processed"])2 ms3.4%
Model.savedjango/db/models/base.py:8742 ms3.4%
Model.save_basedjango/db/models/base.py:9662 ms3.4%
Model._save_tabledjango/db/models/base.py:11102 ms3.4%
Model._do_updatedjango/db/models/base.py:11882 ms3.4%
QuerySet.filterdjango/db/models/query.py:15422 ms3.4%
QuerySet._filter_or_excludedjango/db/models/query.py:15602 ms3.4%
QuerySet._filter_or_exclude_inplacedjango/db/models/query.py:15702 ms3.4%
Query.add_qdjango/db/models/sql/query.py:16712 ms3.4%
Query._add_qdjango/db/models/sql/query.py:17032 ms3.4%
Query.build_filterdjango/db/models/sql/query.py:16132 ms3.4%
ingest_startapps/api/urls.py:95 "muted_tests": [{"name": test.name} for test in muted_tests],2 ms3.4%
QuerySet.__iter__django/db/models/query.py:3902 ms3.4%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms3.4%
ModelIterable.__iter__django/db/models/query.py:952 ms3.4%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16112 ms3.4%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7952 ms3.4%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5782 ms3.4%
WhereNode.as_sqldjango/db/models/sql/where.py:1512 ms3.4%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5782 ms3.4%
IsNull.as_sqldjango/db/models/lookups.py:6722 ms3.4%
BuiltinLookup.process_lhsdjango/db/models/lookups.py:2302 ms3.4%
Lookup.process_lhsdjango/db/models/lookups.py:1092 ms3.4%
BaseExpression.resolve_expressiondjango/db/models/expressions.py:2972 ms3.4%
BaseExpression.copydjango/db/models/expressions.py:4442 ms3.4%
copy<stdlib>/copy.py:1002 ms3.4%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:72 project = get_object_or_404(Project, secrettokens__token=request.headers.get("Authorization"))2 ms3.4%
get_object_or_404django/shortcuts.py:902 ms3.4%
QuerySet.getdjango/db/models/query.py:6352 ms3.4%
QuerySet.__len__django/db/models/query.py:3722 ms3.4%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms3.4%
ModelIterable.__iter__django/db/models/query.py:952 ms3.4%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms3.4%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.4%
TransactionTestCase._pre_setupdjango/test/testcases.py:1164 cls._fixture_setup()2 ms3.4%
TestCase._fixture_setupdjango/test/testcases.py:14782 ms3.4%
TestCase._enter_atomicsdjango/test/testcases.py:13962 ms3.4%
Atomic.__enter__django/db/transaction.py:2112 ms3.4%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms3.4%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:4002 ms3.4%
BaseDatabaseWrapper._savepointdjango/db/backends/base/base.py:3672 ms3.4%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.4%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms3.4%
Cursor.executepsycopg/cursor.py:1132 ms3.4%
Connection.waitpsycopg/connection.py:4952 ms3.4%
Estimated from 29 samples; phase durations are exact. Frames from pytest and pluggy are
hidden
.
Hot lines in your code
|
apps/api/tests.py:352
response = self.client.post(
IngestEnvironmentTest.ingest_start
· Libraries
|
16 ms |
|
apps/api/urls.py:72
project = get_object_or_404(Project, secrettokens__token=request.headers.get("Authorization"))
api_request.<locals>.decorator.<locals>.wrapped_view
· Database
|
4 ms |
|
apps/api/tasks.py:53
ingest = Ingest.objects.only("id").select_for_update().get(id=ingest_id)
process_ingest_start
· Database
|
4 ms |
|
apps/api/tasks.py:79
ingest.project,
process_ingest_start
· Database
|
4 ms |
|
apps/projects/models.py:35
return (model.objects.filter(project_id=project_id).aggregate(last=models.Max("number"))["last"] or 0) + 1
next_number
· App code
|
4 ms |
|
apps/projects/environments.py:63
obj, created = Environment.objects.get_or_create(
get_or_create_environment
· Database
|
4 ms |
|
apps/api/urls.py:57
.values_list("pk", flat=True)
touch_token
· Database
|
2 ms |
|
apps/api/urls.py:59
SecretTokens.objects.filter(pk__in=list(stale)).update(date_last_used=now)
touch_token
· Database
|
2 ms |
|
apps/api/urls.py:91
muted_tests = Test.objects.filter(project=project, mute__date_unmuted__isnull=True, mute__until__gte=timezone.now())
ingest_start
· Database
|
2 ms |
|
apps/projects/models.py:188
super().save(*args, **kwargs)
Run.save
· Database
|
2 ms |
Fixtures
Exact setup time| _dj_autoclear_mailbox function | 0.05 ms |
| _template_string_if_invalid_marker function | 0.03 ms |
| _django_db_marker function | 0.03 ms |
| _live_server_helper function | 0.03 ms |
| _django_set_urlconf function | 0.03 ms |
| _django_clear_site_cache function | 0.02 ms |
| monkeypatch function | 0.01 ms |
Database
61 queries · 12 ms
Repeated queries are usually N+1 lookups: fetch them once with select_related / prefetch_related (or selectinload).
4×
SELECT "projects_project"."id", "projects_project"."organization_id", "projects_project"."name", "projects_project"."slug", "projects_project"."public", "projects_project"."description", "projects_project"."date_created", "projects_project"."date_updated", "projects_project"."created_by_id" FROM "p…
4×
SELECT "projects_environment"."id", "projects_environment"."project_id", "projects_environment"."name", "projects_environment"."kind", "projects_environment"."provider", "projects_environment"."details", "projects_environment"."date_first_seen", "projects_environment"."date_last_seen" FROM "project…
4×
SELECT "projects_session"."id", "projects_session"."project_id", "projects_session"."run_id", "projects_session"."status", "projects_session"."exit_status", "projects_session"."date_created", "projects_session"."date_finished", "projects_session"."ingest_id", "projects_session"."environment_id", "p…
Biggest pieces of work
|
call test body
apps/api/tests.py:389
|
50 ms |
|
call _pre_setup
django/test/testcases.py:1164
|
2 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 | 53 ms | Profile |
| 2 weeks, 4 days ago | CI github-actions:test | passed | 83 ms | Profile |
| 2 weeks, 6 days ago | CI github-actions:test | passed | 39 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 79 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 39 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 66 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 58 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 78 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 39 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 76 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 73 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 74 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 104 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 44 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 82 ms | Profile |