Sha256: ff5a9bf3efc98d74bc519472a4555b47409742e743eb0938d3395d97ff26ff02

Contents?: true

Size: 971 Bytes

Versions: 68

Compression:

Stored size: 971 Bytes

Contents

require 'puppet/indirector'
require 'puppet/util/instrumentation'

# We need to use a class other than Probe for the indirector because
# the Indirection class might declare some probes, and this would be a huge unbreakable
# dependency cycle.
class Puppet::Util::Instrumentation::IndirectionProbe
  extend Puppet::Indirector

  indirects :instrumentation_probe, :terminus_class => :local

  attr_reader :probe_name

  def initialize(probe_name)
    @probe_name = probe_name
  end

  def to_data_hash
    { :name => probe_name }
  end

  def to_pson_data_hash
    {
      :document_type => "Puppet::Util::Instrumentation::IndirectionProbe",
      :data => to_data_hash,
    }
  end

  def to_pson(*args)
    to_pson_data_hash.to_pson(*args)
  end

  def self.from_data_hash(data)
    self.new(data["name"])
  end

  def self.from_pson(data)
    Puppet.deprecation_warning("from_pson is being removed in favour of from_data_hash.")
    self.from_data_hash(data)
  end
end

Version data entries

68 entries across 68 versions & 2 rubygems

Version Path
puppet-3.7.3-x64-mingw32 lib/puppet/util/instrumentation/indirection_probe.rb
puppet-3.7.2 lib/puppet/util/instrumentation/indirection_probe.rb
puppet-3.7.2-x86-mingw32 lib/puppet/util/instrumentation/indirection_probe.rb
puppet-3.7.2-x64-mingw32 lib/puppet/util/instrumentation/indirection_probe.rb
puppet-3.7.1 lib/puppet/util/instrumentation/indirection_probe.rb
puppet-3.7.1-x86-mingw32 lib/puppet/util/instrumentation/indirection_probe.rb
puppet-3.7.1-x64-mingw32 lib/puppet/util/instrumentation/indirection_probe.rb
puppet-3.7.0 lib/puppet/util/instrumentation/indirection_probe.rb
puppet-3.7.0-x86-mingw32 lib/puppet/util/instrumentation/indirection_probe.rb
puppet-3.7.0-x64-mingw32 lib/puppet/util/instrumentation/indirection_probe.rb
puppet-3.6.2 lib/puppet/util/instrumentation/indirection_probe.rb
puppet-3.6.2-x86-mingw32 lib/puppet/util/instrumentation/indirection_probe.rb
puppet-3.6.1 lib/puppet/util/instrumentation/indirection_probe.rb
puppet-3.6.1-x86-mingw32 lib/puppet/util/instrumentation/indirection_probe.rb
puppet-3.6.0 lib/puppet/util/instrumentation/indirection_probe.rb
puppet-3.6.0-x86-mingw32 lib/puppet/util/instrumentation/indirection_probe.rb
puppet-3.6.0.rc1 lib/puppet/util/instrumentation/indirection_probe.rb
puppet-3.6.0.rc1-x86-mingw32 lib/puppet/util/instrumentation/indirection_probe.rb
puppet-3.5.1 lib/puppet/util/instrumentation/indirection_probe.rb
puppet-3.5.1-x86-mingw32 lib/puppet/util/instrumentation/indirection_probe.rb