Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
75c461ce
Commit
75c461ce
authored
Sep 13, 2021
by
David Fernandez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update the examples in the query recorder docs
parent
98a4386b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
doc/development/query_recorder.md
doc/development/query_recorder.md
+4
-4
No files found.
doc/development/query_recorder.md
View file @
75c461ce
...
...
@@ -18,9 +18,9 @@ This style of test works by counting the number of SQL queries executed by Activ
```
ruby
it
"avoids N+1 database queries"
do
control
_count
=
ActiveRecord
::
QueryRecorder
.
new
{
visit_some_page
}.
count
control
=
ActiveRecord
::
QueryRecorder
.
new
{
visit_some_page
}
create_list
(
:issue
,
5
)
expect
{
visit_some_page
}.
not_to
exceed_query_limit
(
control
_count
)
expect
{
visit_some_page
}.
not_to
exceed_query_limit
(
control
)
end
```
...
...
@@ -37,9 +37,9 @@ You should pass the `skip_cached` variable to `QueryRecorder` and use the `excee
```
ruby
it
"avoids N+1 database queries"
,
:use_sql_query_cache
do
control
_count
=
ActiveRecord
::
QueryRecorder
.
new
(
skip_cached:
false
)
{
visit_some_page
}.
count
control
=
ActiveRecord
::
QueryRecorder
.
new
(
skip_cached:
false
)
{
visit_some_page
}
create_list
(
:issue
,
5
)
expect
{
visit_some_page
}.
not_to
exceed_all_query_limit
(
control
_count
)
expect
{
visit_some_page
}.
not_to
exceed_all_query_limit
(
control
)
end
```
...
...
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