Class: Instana::Snapshot::RubyProcess

Inherits:
Object
  • Object
show all
Defined in:
lib/instana/snapshot/ruby_process.rb

Overview

Describes the current Ruby process

Since:

  • 1.197.0

Constant Summary collapse

ID =

Since:

  • 1.197.0

'com.instana.plugin.ruby'.freeze

Instance Method Summary collapse

Constructor Details

#initialize(pid: Process.pid) ⇒ RubyProcess

Returns a new instance of RubyProcess.

Since:

  • 1.197.0



11
12
13
# File 'lib/instana/snapshot/ruby_process.rb', line 11

def initialize(pid: Process.pid)
  @pid = pid
end

Instance Method Details

#dataObject

Since:

  • 1.197.0



19
20
21
# File 'lib/instana/snapshot/ruby_process.rb', line 19

def data
  metrics_data.merge(Util.take_snapshot)
end

#entity_idObject

Since:

  • 1.197.0



15
16
17
# File 'lib/instana/snapshot/ruby_process.rb', line 15

def entity_id
  @pid.to_s
end

#snapshotObject

Since:

  • 1.197.0



23
24
25
26
27
28
29
# File 'lib/instana/snapshot/ruby_process.rb', line 23

def snapshot
  {
    name: ID,
    entityId: entity_id,
    data: data
  }
end