Commit 3707091b authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch 'remove-unused-metrics' into 'master'

Remove gitlab_transaction_cputime_seconds metric

See merge request gitlab-org/gitlab!48023
parents 23800f29 d543485c
......@@ -48,23 +48,15 @@ module Gitlab
@finished_at ? (@finished_at - @started_at) : 0.0
end
def thread_cpu_duration
System.thread_cpu_duration(@thread_cputime_start)
end
def run
Thread.current[THREAD_KEY] = self
@started_at = System.monotonic_time
@thread_cputime_start = System.thread_cpu_time
yield
ensure
@finished_at = System.monotonic_time
observe(:gitlab_transaction_cputime_seconds, thread_cpu_duration) do
buckets SMALL_BUCKETS
end
observe(:gitlab_transaction_duration_seconds, duration) do
buckets SMALL_BUCKETS
end
......
......@@ -20,14 +20,6 @@ RSpec.describe Gitlab::Metrics::Transaction do
end
end
describe '#thread_cpu_duration' do
it 'returns the duration of a transaction in seconds' do
transaction.run { }
expect(transaction.thread_cpu_duration).to be > 0
end
end
describe '#run' do
it 'yields the supplied block' do
expect { |b| transaction.run(&b) }.to yield_control
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment