class Puppet::Util::Instrumentation::Data

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.

Attributes

listener[R]

Public Instance Methods

name() click to toggle source
# File lib/puppet/util/instrumentation/data.rb, line 19
def name
  @listener.name
end
to_data_hash() click to toggle source
# File lib/puppet/util/instrumentation/data.rb, line 23
def to_data_hash
  { :name => name }.merge(@listener.respond_to?(:data) ? @listener.data : {})
end
to_pson(*args) click to toggle source
# File lib/puppet/util/instrumentation/data.rb, line 34
def to_pson(*args)
  to_pson_data_hash.to_pson(*args)
end
to_pson_data_hash() click to toggle source
# File lib/puppet/util/instrumentation/data.rb, line 27
def to_pson_data_hash
  {
    'document_type' => "Puppet::Util::Instrumentation::Data",
    'data' => to_data_hash,
  }
end

Public Class Methods

from_data_hash(data) click to toggle source
# File lib/puppet/util/instrumentation/data.rb, line 38
def self.from_data_hash(data)
  data
end
from_pson(data) click to toggle source
# File lib/puppet/util/instrumentation/data.rb, line 42
def self.from_pson(data)
  Puppet.deprecation_warning("from_pson is being removed in favour of from_data_hash.")
  data
end
new(listener_name) click to toggle source
# File lib/puppet/util/instrumentation/data.rb, line 14
def initialize(listener_name)
  @listener = Puppet::Util::Instrumentation[listener_name]
  raise "Listener #{listener_name} wasn't registered" unless @listener
end