Class: Monitoring::Client::Profiler

Inherits:
Object
  • Object
show all
Defined in:
lib/monitoring/client/profiler.rb

Instance Method Summary collapse

Constructor Details

#initialize(program_name) ⇒ Profiler

Returns a new instance of Profiler.



10
11
12
# File 'lib/monitoring/client/profiler.rb', line 10

def initialize(program_name)
  @program_name = program_name
end

Instance Method Details

#routine(routine_name) {|routine| ... } ⇒ Object

Yields:



15
16
17
18
19
20
# File 'lib/monitoring/client/profiler.rb', line 15

def routine(routine_name)
  routine = Routine.new(routine_name)
  yield(routine)
  UDPSocket.new().send(routine.compile(@program_name).to_json + "\n",
                       0, "localhost", 57475)
end