Sha256: fa16da871f5e1f7347b1047e121ab39f5696fe16804f44053f51709af9f5ef6d

Contents?: true

Size: 355 Bytes

Versions: 2

Compression:

Stored size: 355 Bytes

Contents

# frozen_string_literal: true

module Nanoc
  module Int
    # @api private
    class Instrumentor
      def self.call(key, *args)
        stopwatch = DDMetrics::Stopwatch.new
        stopwatch.start
        yield
      ensure
        stopwatch.stop
        Nanoc::Core::NotificationCenter.post(key, stopwatch.duration, *args)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nanoc-4.11.2 lib/nanoc/base/services/instrumentor.rb
nanoc-4.11.1 lib/nanoc/base/services/instrumentor.rb