Class: LittleGhost::AgentStreamSource

Inherits:
Data
  • Object
show all
Defined in:
lib/little_ghost/agent_stream_source.rb,
lib/little_ghost/agent_stream_source.rb

Overview

Describes which Agent produced an event during a Run.

A :agent_stream StreamEvent carries this value in data[:source] and the Agent's event as a separate frozen StreamEvent in data[:event]. assembly_path is empty for a top-level Agent and contains one AgentStreamStep for each enclosing composite assembly participant.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#agent_idObject (readonly)

Returns the value of attribute agent_id

Returns:

  • (Object)

    the current value of agent_id



47
48
49
# File 'lib/little_ghost/agent_stream_source.rb', line 47

def agent_id
  @agent_id
end

#agent_pathObject (readonly)

Returns the value of attribute agent_path

Returns:

  • (Object)

    the current value of agent_path



47
48
49
# File 'lib/little_ghost/agent_stream_source.rb', line 47

def agent_path
  @agent_path
end

#assembly_pathObject (readonly)

Returns the value of attribute assembly_path

Returns:

  • (Object)

    the current value of assembly_path



47
48
49
# File 'lib/little_ghost/agent_stream_source.rb', line 47

def assembly_path
  @assembly_path
end

#operation_idObject (readonly)

Returns the value of attribute operation_id

Returns:

  • (Object)

    the current value of operation_id



47
48
49
# File 'lib/little_ghost/agent_stream_source.rb', line 47

def operation_id
  @operation_id
end

#parent_operation_idObject (readonly)

Returns the value of attribute parent_operation_id

Returns:

  • (Object)

    the current value of parent_operation_id



47
48
49
# File 'lib/little_ghost/agent_stream_source.rb', line 47

def parent_operation_id
  @parent_operation_id
end

Class Method Details

.build(agent_id:, agent_path:, operation_id:, parent_operation_id:, assembly_path:) ⇒ Object

:nodoc:



54
55
56
57
58
59
60
61
62
# File 'lib/little_ghost/agent_stream_source.rb', line 54

def self.build(agent_id:, agent_path:, operation_id:, parent_operation_id:, assembly_path:) # :nodoc:
  new(
    agent_id: agent_id.to_s.dup.freeze,
    agent_path: agent_path.to_s.dup.freeze,
    operation_id: operation_id.to_s.dup.freeze,
    parent_operation_id: parent_operation_id&.to_s&.dup&.freeze,
    assembly_path: Array(assembly_path).dup.freeze
  ).freeze
end