Class: RTrace

Inherits:
Object
  • Object
show all
Defined in:
lib/bud/rtrace.rb

Overview

:nodoc: all

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bud_instance) ⇒ RTrace



7
8
9
10
11
12
13
14
# File 'lib/bud/rtrace.rb', line 7

def initialize(bud_instance)
  @bud_instance = bud_instance
  return if bud_instance.class == Stratification or
    @bud_instance.class == DepAnalysis
  @table_recv = Bud::BudTable.new(:t_recv_time, @bud_instance, [:pred, :tuple, :time])
  @table_send = Bud::BudTable.new(:t_send_time, @bud_instance, [:pred, :tuple, :time])
  @table_sleep = Bud::BudTable.new(:t_sleep_time, @bud_instance, [:time])
end

Instance Attribute Details

#table_recvObject (readonly)

Returns the value of attribute table_recv



5
6
7
# File 'lib/bud/rtrace.rb', line 5

def table_recv
  @table_recv
end

#table_sendObject (readonly)

Returns the value of attribute table_send



5
6
7
# File 'lib/bud/rtrace.rb', line 5

def table_send
  @table_send
end

#table_sleepObject (readonly)

Returns the value of attribute table_sleep



5
6
7
# File 'lib/bud/rtrace.rb', line 5

def table_sleep
  @table_sleep
end

Instance Method Details

#recv(datum) ⇒ Object



20
21
22
# File 'lib/bud/rtrace.rb', line 20

def recv(datum)
  @table_recv << [datum[0].to_s, datum[1], Time.now.to_f]
end

#send(pred, datum) ⇒ Object



16
17
18
# File 'lib/bud/rtrace.rb', line 16

def send(pred, datum)
  @table_send << [pred.to_s, datum, Time.now.to_f]
end

#sleepObject



24
25
26
# File 'lib/bud/rtrace.rb', line 24

def sleep
  @table_sleep << [Time.now.to_f]
end