Skip to content

Commit 1b3fa02

Browse files
committed
(PUP-5121) Move inlining into compile profile block
Previously the inlining existed as a separate step which was profiled and benchmarked independently of the base compile. This made sanely producing comparisons between static compiles and non-static compiles challenging, so this commit moves the inline_metadata call into the base compile benchmark block. This has the benefit of still allowing the inline_metadata call to be independently benchmarked, while still aggregating it in the default catalog compilation metrics.
1 parent 37ee124 commit 1b3fa02

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

lib/puppet/indirector/catalog/compiler.rb

+11-9
Original file line numberDiff line numberDiff line change
@@ -242,26 +242,28 @@ def compile(node, options)
242242
config = nil
243243

244244
benchmark(:notice, str) do
245-
Puppet::Util::Profiler.profile(str, [:compiler, :compile, node.environment, node.name]) do
245+
compile_type = checksum_type ? :static_compile : :compile
246+
Puppet::Util::Profiler.profile(str, [:compiler, compile_type, node.environment, node.name]) do
246247
begin
247248
config = Puppet::Parser::Compiler.compile(node, options[:code_id])
248249
rescue Puppet::Error => detail
249250
Puppet.err(detail.to_s) if networked?
250251
raise
251252
end
252-
end
253-
end
254253

255-
if checksum_type && config.is_a?(model)
256-
str = "Inlined resource metadata into static catalog for #{node.name}"
257-
str += " in environment #{node.environment}" if node.environment
258-
benchmark(:notice, str) do
259-
Puppet::Util::Profiler.profile(str, [:compiler, :static_inline, node.environment, node.name]) do
260-
inline_metadata(config, checksum_type)
254+
if checksum_type && config.is_a?(model)
255+
str = "Inlined resource metadata into static catalog for #{node.name}"
256+
str += " in environment #{node.environment}" if node.environment
257+
benchmark(:notice, str) do
258+
Puppet::Util::Profiler.profile(str, [:compiler, :static_compile_postprocessing, node.environment, node.name]) do
259+
inline_metadata(config, checksum_type)
260+
end
261+
end
261262
end
262263
end
263264
end
264265

266+
265267
config
266268
end
267269

0 commit comments

Comments
 (0)