diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2016-06-14 14:39:19 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2016-06-14 14:39:19 +0300 |
commit | 4b964011cfd6861403726248574f5926edc5d495 (patch) | |
tree | 9decb7fc9224b6e8625200200eeacf33eae02183 /doc | |
parent | ab3fb00c429133ac4aa98887314dba3a167b919c (diff) | |
parent | 120fbbd4875f340b5c863b7e0e3eabcb2796e15d (diff) |
Merge branch '18528-cpu-time-instrumentation' into 'master'
Measure CPU time for instrumented methods
See merge request !4640
Diffstat (limited to 'doc')
-rw-r--r-- | doc/development/instrumentation.md | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/doc/development/instrumentation.md b/doc/development/instrumentation.md index 9168c70945a..50d2866ca46 100644 --- a/doc/development/instrumentation.md +++ b/doc/development/instrumentation.md @@ -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 |