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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
57f9ee0b
Commit
57f9ee0b
authored
Nov 09, 2016
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more highlighting to Instrumentation doc
[ci skip]
parent
9a2ad60f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
doc/development/instrumentation.md
doc/development/instrumentation.md
+5
-5
No files found.
doc/development/instrumentation.md
View file @
57f9ee0b
...
@@ -24,7 +24,7 @@ namespace you can use the `configure` class method. This method simply yields
...
@@ -24,7 +24,7 @@ namespace you can use the `configure` class method. This method simply yields
the supplied block while passing
`Gitlab::Metrics::Instrumentation`
as its
the supplied block while passing
`Gitlab::Metrics::Instrumentation`
as its
argument. An example:
argument. An example:
```
```
ruby
Gitlab
::
Metrics
::
Instrumentation
.
configure
do
|
conf
|
Gitlab
::
Metrics
::
Instrumentation
.
configure
do
|
conf
|
conf
.
instrument_method
(
Foo
,
:bar
)
conf
.
instrument_method
(
Foo
,
:bar
)
conf
.
instrument_method
(
Foo
,
:baz
)
conf
.
instrument_method
(
Foo
,
:baz
)
...
@@ -41,7 +41,7 @@ Method instrumentation should be added in the initializer
...
@@ -41,7 +41,7 @@ Method instrumentation should be added in the initializer
Instrumenting a single method:
Instrumenting a single method:
```
```
ruby
Gitlab
::
Metrics
::
Instrumentation
.
configure
do
|
conf
|
Gitlab
::
Metrics
::
Instrumentation
.
configure
do
|
conf
|
conf
.
instrument_method
(
User
,
:find_by
)
conf
.
instrument_method
(
User
,
:find_by
)
end
end
...
@@ -49,7 +49,7 @@ end
...
@@ -49,7 +49,7 @@ end
Instrumenting an entire class hierarchy:
Instrumenting an entire class hierarchy:
```
```
ruby
Gitlab
::
Metrics
::
Instrumentation
.
configure
do
|
conf
|
Gitlab
::
Metrics
::
Instrumentation
.
configure
do
|
conf
|
conf
.
instrument_class_hierarchy
(
ActiveRecord
::
Base
)
conf
.
instrument_class_hierarchy
(
ActiveRecord
::
Base
)
end
end
...
@@ -57,7 +57,7 @@ end
...
@@ -57,7 +57,7 @@ end
Instrumenting all public class methods:
Instrumenting all public class methods:
```
```
ruby
Gitlab
::
Metrics
::
Instrumentation
.
configure
do
|
conf
|
Gitlab
::
Metrics
::
Instrumentation
.
configure
do
|
conf
|
conf
.
instrument_methods
(
User
)
conf
.
instrument_methods
(
User
)
end
end
...
@@ -68,7 +68,7 @@ end
...
@@ -68,7 +68,7 @@ end
The easiest way to check if a method has been instrumented is to check its
The easiest way to check if a method has been instrumented is to check its
source location. For example:
source location. For example:
```
```
ruby
method
=
Rugged
::
TagCollection
.
instance_method
(
:[]
)
method
=
Rugged
::
TagCollection
.
instance_method
(
:[]
)
method
.
source_location
method
.
source_location
...
...
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