Commit 2ee01237 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'kassio/github-importer-fix-histogram' into 'master'

GithubImporter: Fix import duration metric

See merge request gitlab-org/gitlab!74610
parents 01dca126 4ef1a8e3
......@@ -69,12 +69,8 @@ module Gitlab
end
def observe_histogram
if project.github_import?
duration_histogram.observe({ project: project.full_path }, duration)
else
duration_histogram.observe({ importer: importer }, duration)
end
end
def track_finish_metric
return unless project.github_import?
......
......@@ -94,20 +94,6 @@ RSpec.describe Gitlab::Import::Metrics, :aggregate_failures do
expect(histogram).to have_received(:observe).with({ importer: :test_importer }, anything)
end
end
context 'when project is a github import' do
before do
project.import_type = 'github'
end
it 'emits importer metrics' do
expect(subject).to receive(:track_usage_event).with(:github_import_project_success, project.id)
subject.track_finished_import
expect(histogram).to have_received(:observe).with({ project: project.full_path }, anything)
end
end
end
describe '#issues_counter' do
......
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