Tests / apps/mcp/tests.py
McpTest::test_compare_environments
First seen 1 month, 1 week ago in 78a4357
CI
github-actions:test
15 runs
Average
47 ms
median 51 ms
max 76 ms
max 76 ms
Phases
Setup 0.64 ms
Call 47 ms
Teardown 0.15 ms
Categories
Database 19 ms
App code 0.63 ms
Test code 0.21 ms
Other (Libraries, Unsampled, pytest) 27 ms
18 database queries per run
Needs 236 KB of memory (max 800 KB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, 2 weeks ago ·
open run
call38 ms98.2%
McpTest.test_compare_environmentsapps/mcp/tests.py:245 result = self.call("compare_environments", env_a="ci", env_b="local")36 ms92.1%
McpTest.callapps/mcp/tests.py:8236 ms92.1%
McpTest.rpcapps/mcp/tests.py:7536 ms92.1%
McpTest.postapps/mcp/tests.py:67 return self.client.post(36 ms92.1%
Client.postdjango/test/client.py:115336 ms92.1%
RequestFactory.postdjango/test/client.py:49936 ms92.1%
RequestFactory.genericdjango/test/client.py:67136 ms92.1%
Client.requestdjango/test/client.py:108236 ms92.1%
ClientHandler.__call__django/test/client.py:17319 ms49.1%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6219 ms49.1%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10419 ms49.1%
WhiteNoise.add_fileswhitenoise/base.py:10819 ms49.1%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12014 ms36.8%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13114 ms36.8%
WhiteNoise.get_static_filewhitenoise/base.py:20812 ms30.7%
StaticFile.__init__whitenoise/responders.py:742 ms6.1%
Headers.__getitem__<stdlib>/wsgiref/headers.py:832 ms6.1%
StaticFile.__init__whitenoise/responders.py:772 ms6.1%
StaticFile.get_alternativeswhitenoise/responders.py:2002 ms6.1%
__init____init__:-12 ms6.1%
Headers._convert_string_type<stdlib>/wsgiref/headers.py:502 ms6.1%
StaticFile.__init__whitenoise/responders.py:732 ms6.1%
StaticFile.get_headerswhitenoise/responders.py:1782 ms6.1%
StaticFile.__init__whitenoise/responders.py:762 ms6.1%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1892 ms6.1%
WhiteNoise.get_static_filewhitenoise/base.py:2032 ms6.1%
WhiteNoise.add_cache_headerswhitenoise/base.py:2242 ms6.1%
WhiteNoiseMiddleware.immutable_file_testwhitenoise/middleware.py:1762 ms6.1%
WhiteNoiseMiddleware.get_static_urlwhitenoise/middleware.py:1972 ms6.1%
URLMixin.urldebug_toolbar/panels/staticfiles.py:202 ms6.1%
HashedFilesMixin.urldjango/contrib/staticfiles/storage.py:2052 ms6.1%
HashedFilesMixin._urldjango/contrib/staticfiles/storage.py:1862 ms6.1%
FileSystemStorage.urldjango/core/files/storage/filesystem.py:2092 ms6.1%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1155 ms12.3%
scantreewhitenoise/base.py:2642 ms6.1%
scantreewhitenoise/base.py:2622 ms6.1%
scantreewhitenoise/base.py:2622 ms6.1%
scantreewhitenoise/base.py:2622 ms6.1%
scantreewhitenoise/base.py:2622 ms6.1%
scantreewhitenoise/base.py:2622 ms6.1%
scantreewhitenoise/base.py:2642 ms6.1%
<GC>~2 ms6.1%
ClientHandler.__call__django/test/client.py:18614 ms36.8%
BaseHandler.get_responsedjango/core/handlers/base.py:14114 ms36.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5514 ms36.8%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:13014 ms36.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5514 ms36.8%
MiddlewareMixin.__call__django/utils/deprecation.py:30914 ms36.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5514 ms36.8%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:12314 ms36.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5514 ms36.8%
MiddlewareMixin.__call__django/utils/deprecation.py:30914 ms36.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5514 ms36.8%
MiddlewareMixin.__call__django/utils/deprecation.py:30914 ms36.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5514 ms36.8%
MiddlewareMixin.__call__django/utils/deprecation.py:30914 ms36.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5514 ms36.8%
MiddlewareMixin.__call__django/utils/deprecation.py:30910 ms24.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5510 ms24.6%
MiddlewareMixin.__call__django/utils/deprecation.py:30910 ms24.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5510 ms24.6%
MiddlewareMixin.__call__django/utils/deprecation.py:30910 ms24.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5510 ms24.6%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:3410 ms24.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5510 ms24.6%
BaseHandler._get_responsedjango/core/handlers/base.py:19810 ms24.6%
csrf_exempt.<locals>._view_wrapperdjango/views/decorators/csrf.py:6510 ms24.6%
mcpapps/mcp/urls.py:1477 ms18.4%
handleapps/mcp/urls.py:1157 ms18.4%
call_toolapps/mcp/urls.py:757 ms18.4%
Tools.callapps/mcp/tools.py:1887 ms18.4%
Tools.compare_environmentsapps/mcp/tools.py:3887 ms18.4%
compareapps/projects/analytics.py:6542 ms6.1%
averages_by_testapps/projects/analytics.py:631 for row in daily_totals(rows)2 ms6.1%
QuerySet.__iter__django/db/models/query.py:3902 ms6.1%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms6.1%
ValuesIterable.__iter__django/db/models/query.py:2222 ms6.1%
SQLCompiler.results_iterdjango/db/models/sql/compiler.py:15732 ms6.1%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms6.1%
CursorWrapper.executedjango/db/backends/utils.py:792 ms6.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms6.1%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms6.1%
Cursor.executepsycopg/cursor.py:1132 ms6.1%
Connection.waitpsycopg/connection.py:4952 ms6.1%
compareapps/projects/analytics.py:6552 ms6.1%
averages_by_testapps/projects/analytics.py:631 for row in daily_totals(rows)2 ms6.1%
QuerySet.__iter__django/db/models/query.py:3902 ms6.1%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms6.1%
ValuesIterable.__iter__django/db/models/query.py:2222 ms6.1%
SQLCompiler.results_iterdjango/db/models/sql/compiler.py:15732 ms6.1%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms6.1%
CursorWrapper.executedjango/db/backends/utils.py:792 ms6.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms6.1%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms6.1%
Cursor.executepsycopg/cursor.py:1132 ms6.1%
Connection.waitpsycopg/connection.py:4952 ms6.1%
compareapps/projects/analytics.py:7112 ms6.1%
compare.<locals>.side_summaryapps/projects/analytics.py:695 summaries = list(2 ms6.1%
QuerySet.__iter__django/db/models/query.py:3902 ms6.1%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms6.1%
SQLCompiler.apply_convertersdjango/db/models/sql/compiler.py:15422 ms6.1%
mcpapps/mcp/urls.py:1252 ms6.1%
authenticateapps/mcp/urls.py:57 SecretTokens.objects.filter(token=token).update(date_last_used=timezone.now())2 ms6.1%
QuerySet.updatedjango/db/models/query.py:13002 ms6.1%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21112 ms6.1%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms6.1%
CursorWrapper.executedjango/db/backends/utils.py:792 ms6.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms6.1%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms6.1%
Cursor.executepsycopg/cursor.py:1132 ms6.1%
Connection.waitpsycopg/connection.py:4952 ms6.1%
MiddlewareMixin.__call__django/utils/deprecation.py:3085 ms12.3%
AuthenticationMiddleware.process_requestdjango/contrib/auth/middleware.py:412 ms6.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:552 ms6.1%
MiddlewareMixin.__call__django/utils/deprecation.py:3092 ms6.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:552 ms6.1%
MiddlewareMixin.__call__django/utils/deprecation.py:3092 ms6.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:552 ms6.1%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:342 ms6.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:552 ms6.1%
BaseHandler._get_responsedjango/core/handlers/base.py:1982 ms6.1%
csrf_exempt.<locals>._view_wrapperdjango/views/decorators/csrf.py:652 ms6.1%
mcpapps/mcp/urls.py:1252 ms6.1%
authenticateapps/mcp/urls.py:55 project = Project.objects.filter(secrettokens__token=token).first()2 ms6.1%
QuerySet.firstdjango/db/models/query.py:11452 ms6.1%
QuerySet.__iter__django/db/models/query.py:3902 ms6.1%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms6.1%
ModelIterable.__iter__django/db/models/query.py:952 ms6.1%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms6.1%
CursorWrapper.executedjango/db/backends/utils.py:792 ms6.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms6.1%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms6.1%
Cursor.executepsycopg/cursor.py:1132 ms6.1%
Connection.waitpsycopg/connection.py:4952 ms6.1%
ClientHandler.__call__django/test/client.py:2072 ms6.1%
HttpResponseBase.closedjango/http/response.py:3412 ms6.1%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()2 ms6.1%
TestCase._fixture_teardowndjango/test/testcases.py:14952 ms6.1%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4832 ms6.1%
CursorWrapper.executedjango/db/backends/utils.py:792 ms6.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms6.1%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms6.1%
Cursor.executepsycopg/cursor.py:1132 ms6.1%
Connection.waitpsycopg/connection.py:4952 ms6.1%
Estimated from 16 samples; phase durations are exact. Frames from pytest and pluggy are
hidden
.
Hot lines in your code
|
apps/mcp/tests.py:67
return self.client.post(
McpTest.post
· Libraries
|
24 ms |
|
apps/projects/analytics.py:631
for row in daily_totals(rows)
averages_by_test
· Database
|
5 ms |
|
apps/mcp/urls.py:55
project = Project.objects.filter(secrettokens__token=token).first()
authenticate
· Database
|
2 ms |
|
apps/mcp/urls.py:57
SecretTokens.objects.filter(token=token).update(date_last_used=timezone.now())
authenticate
· Database
|
2 ms |
|
apps/projects/analytics.py:695
summaries = list(
compare.<locals>.side_summary
· Database
|
2 ms |
Fixtures
Exact setup time| _dj_autoclear_mailbox function | 0.05 ms |
| _template_string_if_invalid_marker function | 0.04 ms |
| _django_db_marker function | 0.03 ms |
| _django_set_urlconf function | 0.03 ms |
| _live_server_helper function | 0.03 ms |
| _django_clear_site_cache function | 0.02 ms |
| monkeypatch function | 0.02 ms |
Database
18 queries · 6 ms
Repeated queries are usually N+1 lookups: fetch them once with select_related / prefetch_related (or selectinload).
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…
Biggest pieces of work
|
call test body
apps/mcp/tests.py:245
|
36 ms |
|
call _post_teardown
django/test/testcases.py:1240
|
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 | 39 ms | Profile |
| 2 weeks, 4 days ago | CI github-actions:test | passed | 50 ms | Profile |
| 2 weeks, 6 days ago | CI github-actions:test | passed | 25 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 51 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 34 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 52 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 48 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 76 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 39 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 54 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 54 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 52 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 56 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 27 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 52 ms | Profile |