Sha256: eb155da9a24870b51ec4983b85777e441f716c10355d100d25320eb7b0334565

Contents?: true

Size: 891 Bytes

Versions: 60

Compression:

Stored size: 891 Bytes

Contents

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

# This is just a transport class to be used through the instrumentation_data
# indirection. All the data resides in the real underlying listeners which this
# class delegates to.
class Puppet::Util::Instrumentation::Data
  extend Puppet::Indirector

  indirects :instrumentation_data, :terminus_class => :local

  attr_reader :listener

  def initialize(listener_name)
    @listener = Puppet::Util::Instrumentation[listener_name]
    raise "Listener #{listener_name} wasn't registered" unless @listener
  end

  def name
    @listener.name
  end

  def to_pson(*args)
    result = {
      'document_type' => "Puppet::Util::Instrumentation::Data",
      'data' => { :name => name }.merge(@listener.respond_to?(:data) ? @listener.data : {})
    }
    result.to_pson(*args)
  end

  def self.from_pson(data)
    data
  end
end

Version data entries

60 entries across 60 versions & 3 rubygems

Version Path
puppet-2.7.22 lib/puppet/util/instrumentation/data.rb
puppet-3.2.1 lib/puppet/util/instrumentation/data.rb
puppet-3.2.1.rc1 lib/puppet/util/instrumentation/data.rb
puppet-3.2.0.rc2 lib/puppet/util/instrumentation/data.rb
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/puppet-3.1.0/lib/puppet/util/instrumentation/data.rb
puppet-3.2.0.rc1 lib/puppet/util/instrumentation/data.rb
puppet-parse-0.1.0 lib/vendor/puppet/util/instrumentation/data.rb
puppet-parse-0.0.6 lib/vendor/puppet/util/instrumentation/data.rb
puppet-2.7.21 lib/puppet/util/instrumentation/data.rb
puppet-3.1.1 lib/puppet/util/instrumentation/data.rb
puppet-parse-0.0.5 lib/vendor/puppet/util/instrumentation/data.rb
puppet-parse-0.0.4 lib/vendor/puppet/util/instrumentation/data.rb
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/puppet-3.1.0/lib/puppet/util/instrumentation/data.rb
puppet-3.1.0 lib/puppet/util/instrumentation/data.rb
puppet-3.1.0.rc2 lib/puppet/util/instrumentation/data.rb
puppet-3.1.0.rc1 lib/puppet/util/instrumentation/data.rb
puppet-3.0.2 lib/puppet/util/instrumentation/data.rb
puppet-3.0.2.rc3 lib/puppet/util/instrumentation/data.rb
puppet-3.0.2.rc2 lib/puppet/util/instrumentation/data.rb
puppet-3.0.2.rc1 lib/puppet/util/instrumentation/data.rb