Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
040b1c3d
Commit
040b1c3d
authored
Sep 15, 2014
by
Don Mitchell
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5197 from edx/reruns/count_queries
Explain query counts
parents
65684635
b137f8d7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
20 deletions
+24
-20
cms/djangoapps/contentstore/tests/test_course_listing.py
+6
-4
cms/envs/test.py
+0
-11
common/lib/xmodule/xmodule/modulestore/split_mongo/split.py
+3
-0
common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
+0
-0
common/lib/xmodule/xmodule/modulestore/tests/test_publish.py
+15
-5
No files found.
cms/djangoapps/contentstore/tests/test_course_listing.py
View file @
040b1c3d
...
...
@@ -200,12 +200,14 @@ class TestCourseListing(ModuleStoreTestCase):
self
.
assertGreaterEqual
(
iteration_over_courses_time_2
.
elapsed
,
iteration_over_groups_time_2
.
elapsed
)
# Now count the db queries
store
=
modulestore
()
.
_get_modulestore_by_type
(
ModuleStoreEnum
.
Type
.
mongo
)
with
check_mongo_calls
(
USER_COURSES_COUNT
):
_accessible_courses_list_from_groups
(
self
.
request
)
# TODO: LMS-11220: Document why this takes 6 calls
with
check_mongo_calls
(
6
):
# Calls:
# 1) query old mongo
# 2) get_more on old mongo
# 3) query split (but no courses so no fetching of data)
with
check_mongo_calls
(
3
):
_accessible_courses_list
(
self
.
request
)
def
test_get_course_list_with_same_course_id
(
self
):
...
...
@@ -276,7 +278,7 @@ class TestCourseListing(ModuleStoreTestCase):
course_location
=
SlashSeparatedCourseKey
(
'testOrg'
,
'erroredCourse'
,
'RunBabyRun'
)
course
=
self
.
_create_course_with_access_groups
(
course_location
,
self
.
user
)
course_db_record
=
store
.
_find_one
(
course
.
location
)
course_db_record
.
setdefault
(
'metadata'
,
{})
.
get
(
'tabs'
,
[])
.
append
({
"type"
:
"wiko"
,
"name"
:
"Wiki"
})
course_db_record
.
setdefault
(
'metadata'
,
{})
.
get
(
'tabs'
,
[])
.
append
({
"type"
:
"wiko"
,
"name"
:
"Wiki"
})
store
.
collection
.
update
(
{
'_id'
:
course
.
location
.
to_deprecated_son
()},
{
'$set'
:
{
...
...
cms/envs/test.py
View file @
040b1c3d
...
...
@@ -73,17 +73,6 @@ STATICFILES_STORAGE='pipeline.storage.NonPackagingPipelineStorage'
STATIC_URL
=
"/static/"
PIPELINE_ENABLED
=
False
# Add split as another store for testing
MODULESTORE
[
'default'
][
'OPTIONS'
][
'stores'
]
.
append
(
{
'NAME'
:
'split'
,
'ENGINE'
:
'xmodule.modulestore.split_mongo.split_draft.DraftVersioningModuleStore'
,
'DOC_STORE_CONFIG'
:
DOC_STORE_CONFIG
,
'OPTIONS'
:
{
'render_template'
:
'edxmako.shortcuts.render_to_string'
,
}
},
)
# Update module store settings per defaults for tests
update_module_store_settings
(
MODULESTORE
,
...
...
common/lib/xmodule/xmodule/modulestore/split_mongo/split.py
View file @
040b1c3d
...
...
@@ -681,6 +681,9 @@ class SplitMongoModuleStore(SplitBulkWriteMixin, ModuleStoreWriteBase):
version_guids
.
append
(
version_guid
)
id_version_map
[
version_guid
]
=
course_index
if
not
version_guids
:
return
[]
matching_structures
=
self
.
find_structures_by_id
(
version_guids
)
# get the blocks for each course index (s/b the root)
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
View file @
040b1c3d
This diff is collapsed.
Click to expand it.
common/lib/xmodule/xmodule/modulestore/tests/test_publish.py
View file @
040b1c3d
...
...
@@ -89,11 +89,21 @@ class TestPublish(SplitWMongoCourseBoostrapper):
"""
vert_location
=
self
.
old_course_key
.
make_usage_key
(
'vertical'
,
block_id
=
'Vert1'
)
item
=
self
.
draft_mongo
.
get_item
(
vert_location
,
2
)
# Vert1 has 3 children; so, publishes 4 nodes which may mean 4 inserts & 1 bulk remove
# TODO: LMS-11220: Document why find count is 25
# 25-June-2014 find calls are 19. Probably due to inheritance recomputation?
# 02-July-2014 send calls are 7. 5 from above, plus 2 for updating subtree edit info for Chapter1 and course
# find calls are 22. 19 from above, plus 3 for finding the parent of Vert1, Chapter1, and course
# Finds:
# 1 get draft vert,
# 2-10 for each child: (3 children x 3 queries each)
# get draft and then published child
# compute inheritance
# 11 get published vert
# 12-15 get each ancestor (count then get): (2 x 2),
# 16 then fail count of course parent (1)
# 17 compute inheritance
# 18 get last error
# 19-20 get draft and published vert
# Sends:
# delete the subtree of drafts (1 call),
# update the published version of each node in subtree (4 calls),
# update the ancestors up to course (2 calls)
with
check_mongo_calls
(
20
,
7
):
self
.
draft_mongo
.
publish
(
item
.
location
,
self
.
user_id
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment