From 6ef96cc15a5bcbcf7415e80d048d6bdaf2bd2670 Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Sun, 24 Aug 2014 15:49:53 -0700 Subject: [PATCH] more instrumenting --- middleman-core/lib/middleman-core/file_renderer.rb | 4 +++- middleman-core/lib/middleman-core/logger.rb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/middleman-core/lib/middleman-core/file_renderer.rb b/middleman-core/lib/middleman-core/file_renderer.rb index 59d983de..5d11a682 100644 --- a/middleman-core/lib/middleman-core/file_renderer.rb +++ b/middleman-core/lib/middleman-core/file_renderer.rb @@ -75,7 +75,9 @@ module Middleman end # Render using Tilt - content = template.render(context, locs, &block) + content = ::Middleman::Util.instrument 'render.tilt', path: path do + template.render(context, locs, &block) + end # Allow hooks to manipulate the result after render @app.class.callbacks_for_hook(:after_render).each do |callback| diff --git a/middleman-core/lib/middleman-core/logger.rb b/middleman-core/lib/middleman-core/logger.rb index 7d361946..5a1f3f0b 100644 --- a/middleman-core/lib/middleman-core/logger.rb +++ b/middleman-core/lib/middleman-core/logger.rb @@ -40,7 +40,7 @@ module Middleman return if @instrumenting.is_a?(String) && @instrumenting != 'instrument' && !message.include?(@instrumenting) evt = ActiveSupport::Notifications::Event.new(message, *args) - info "== Instrument (#{evt.name.sub(/.middleman$/, '')}): #{evt.duration}ms" + info "== Instrument (#{evt.name.sub(/.middleman$/, '')}): #{evt.duration}ms\n#{args.last}" end end end