Sha256: a884564da2afdc24f684dafa278540cbd04b440f59e4bafbdcc6df778b13023e

Contents?: true

Size: 556 Bytes

Versions: 3

Compression:

Stored size: 556 Bytes

Contents

require "vagrant-libvirt/util/timer"

module VagrantPlugins
  module Libvirt
    module Action
      # This is the same as the builtin provision except it times the
      # provisioner runs.
      class TimedProvision < Vagrant::Action::Builtin::Provision
        def run_provisioner(env, p)
          timer = Util::Timer.time do
            super
          end

          env[:metrics] ||= {}
          env[:metrics]["provisioner_times"] ||= []
          env[:metrics]["provisioner_times"] << [p.class.to_s, timer]
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vagrant-libvirt-0.0.3 lib/vagrant-libvirt/action/timed_provision.rb
vagrant-libvirt-0.0.2 lib/vagrant-libvirt/action/timed_provision.rb
vagrant-libvirt-0.0.1 lib/vagrant-libvirt/action/timed_provision.rb