Skip to content
Snippets Groups Projects
Commit 57f9ee0b authored by Robert Speicher's avatar Robert Speicher
Browse files

Add more highlighting to Instrumentation doc

[ci skip]
parent 9a2ad60f
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
argument. An example:
 
```
```ruby
Gitlab::Metrics::Instrumentation.configure do |conf|
conf.instrument_method(Foo, :bar)
conf.instrument_method(Foo, :baz)
Loading
Loading
@@ -41,7 +41,7 @@ Method instrumentation should be added in the initializer
 
Instrumenting a single method:
 
```
```ruby
Gitlab::Metrics::Instrumentation.configure do |conf|
conf.instrument_method(User, :find_by)
end
Loading
Loading
@@ -49,7 +49,7 @@ end
 
Instrumenting an entire class hierarchy:
 
```
```ruby
Gitlab::Metrics::Instrumentation.configure do |conf|
conf.instrument_class_hierarchy(ActiveRecord::Base)
end
Loading
Loading
@@ -57,7 +57,7 @@ end
 
Instrumenting all public class methods:
 
```
```ruby
Gitlab::Metrics::Instrumentation.configure do |conf|
conf.instrument_methods(User)
end
Loading
Loading
@@ -68,7 +68,7 @@ end
The easiest way to check if a method has been instrumented is to check its
source location. For example:
 
```
```ruby
method = Rugged::TagCollection.instance_method(:[])
 
method.source_location
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment