summaryrefslogtreecommitdiff
path: root/doc/development/instrumentation.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/development/instrumentation.md')
-rw-r--r--doc/development/instrumentation.md15
1 files changed, 8 insertions, 7 deletions
diff --git a/doc/development/instrumentation.md b/doc/development/instrumentation.md
index 9168c70945a..6cd9b274d11 100644
--- a/doc/development/instrumentation.md
+++ b/doc/development/instrumentation.md
@@ -15,8 +15,8 @@ instrument code:
* `instrument_instance_method`: instruments a single instance method.
* `instrument_class_hierarchy`: given a Class this method will recursively
instrument all sub-classes (both class and instance methods).
-* `instrument_methods`: instruments all public class methods of a Module.
-* `instrument_instance_methods`: instruments all public instance methods of a
+* `instrument_methods`: instruments all public and private class methods of a Module.
+* `instrument_instance_methods`: instruments all public and private instance methods of a
Module.
To remove the need for typing the full `Gitlab::Metrics::Instrumentation`
@@ -97,15 +97,16 @@ def #{name}(#{args_signature})
trans = Gitlab::Metrics::Instrumentation.transaction
if trans
- start = Time.now
- retval = super
- duration = (Time.now - start) * 1000.0
+ start = Time.now
+ cpu_start = Gitlab::Metrics::System.cpu_time
+ retval = super
+ duration = (Time.now - start) * 1000.0
if duration >= Gitlab::Metrics.method_call_threshold
- trans.increment(:method_duration, duration)
+ cpu_duration = Gitlab::Metrics::System.cpu_time - cpu_start
trans.add_metric(Gitlab::Metrics::Instrumentation::SERIES,
- { duration: duration },
+ { duration: duration, cpu_duration: cpu_duration },
method: #{label.inspect})
end