Sha256: 32aeb3e0bd881f522ddb3faf9481a733476e403cad7461b446a63359153abe30

Contents?: true

Size: 698 Bytes

Versions: 8

Compression:

Stored size: 698 Bytes

Contents

require "vagrant-libvirt/util/timer"

module VagrantPlugins
  module ProviderLibvirt
    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, name, p)
          env[:ui].info(I18n.t("vagrant.actions.vm.provision.beginning",
                               :provisioner => name))

          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

8 entries across 8 versions & 1 rubygems

Version Path
vagrant-libvirt-0.0.14 lib/vagrant-libvirt/action/timed_provision.rb
vagrant-libvirt-0.0.13 lib/vagrant-libvirt/action/timed_provision.rb
vagrant-libvirt-0.0.12 lib/vagrant-libvirt/action/timed_provision.rb
vagrant-libvirt-0.0.11 lib/vagrant-libvirt/action/timed_provision.rb
vagrant-libvirt-0.0.10 lib/vagrant-libvirt/action/timed_provision.rb
vagrant-libvirt-0.0.9 lib/vagrant-libvirt/action/timed_provision.rb
vagrant-libvirt-0.0.8 lib/vagrant-libvirt/action/timed_provision.rb
vagrant-libvirt-0.0.7 lib/vagrant-libvirt/action/timed_provision.rb