Skip to content
代码片段 群组 项目
未验证 提交 d15ba5b7 编辑于 作者: Avielle Wolfe's avatar Avielle Wolfe 提交者: GitLab
浏览文件

Instrument include:component content load times

We track generic include file load times in the
`config_file_fetch_content_hash` metric. However, we might introduce a
feature that would increase the load times specifically when loading
components, so we need a metric that only tracks component content load
times.

Issue: https://gitlab.com/gitlab-org/gitlab/-/issues/438275?work_item_iid=471843
上级 d15a5db7
No related branches found
No related tags found
无相关合并请求
......@@ -62,6 +62,13 @@ def validate_content!
attr_reader :path, :version
def content_result
context.logger.instrument(:config_component_fetch_content_hash) do
super
end
end
strong_memoize_attr :content_result
def component_result
::Ci::Components::FetchService.new(
address: location,
......
......@@ -210,4 +210,26 @@
end
end
end
describe '#load_and_validate_expanded_hash!' do
let(:logger) { instance_double(::Gitlab::Ci::Pipeline::Logger, :instrument) }
let(:context_params) do
{
project: context_project,
sha: 'context_sha',
user: user,
variables: project_variables,
logger: logger
}
end
it 'tracks the content load time' do
expect(logger).to receive(:instrument).once.ordered.with(:config_component_fetch_content_hash).and_yield
expect(logger).to receive(:instrument).once.ordered.with(:config_file_fetch_content_hash).and_yield
expect(logger).to receive(:instrument).once.ordered.with(:config_file_expand_content_includes).and_yield
external_resource.load_and_validate_expanded_hash!
end
end
end
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册