Commit ce054552 authored by Eduardo Bonet's avatar Eduardo Bonet

Changes counter name, improves testing

parent 353924ef
......@@ -65,7 +65,7 @@ module Gitlab
def rendered_timeout
@rendered_timeout ||= Gitlab::Metrics.counter(
:rendered_timeout,
:ipynb_semantic_diff_timeouts_total,
'Counts the times notebook rendering timed out'
)
end
......@@ -80,7 +80,7 @@ module Gitlab
def log_event(message, error = nil)
Gitlab::AppLogger.info({ message: message })
Gitlab::ErrorTracking.log_exception(error) if error
Gitlab::ErrorTracking.track_exception(error) if error
nil
end
end
......
......@@ -53,8 +53,9 @@ RSpec.describe Gitlab::Diff::CustomDiff do
end
it 'increments metrics' do
counter = Gitlab::Metrics.counter(:ipynb_semantic_diff_timeouts_total, 'desc')
expect(Timeout).to receive(:timeout).and_raise(Timeout::Error)
counter = Gitlab::Metrics.counter(:rendered_timeout, 'desc')
expect { subject }.to change { counter.get(source: described_class::FOREGROUND_EXECUTION) }.by(1)
end
end
......@@ -71,8 +72,9 @@ RSpec.describe Gitlab::Diff::CustomDiff do
end
it 'increments metrics' do
counter = Gitlab::Metrics.counter(:ipynb_semantic_diff_timeouts_total, 'desc')
expect(Timeout).to receive(:timeout).and_raise(Timeout::Error)
counter = Gitlab::Metrics.counter(:rendered_timeout, 'desc')
expect { subject }.to change { counter.get(source: described_class::BACKGROUND_EXECUTION) }.by(1)
end
end
......
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