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

- (RTrace) initialize(bud_instance)



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

- (Object) table_recv (readonly)

Returns the value of attribute table_recv



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

def table_recv
  @table_recv
end

- (Object) table_send (readonly)

Returns the value of attribute table_send



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

def table_send
  @table_send
end

- (Object) table_sleep (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

- (Object) recv(datum)



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

- (Object) send(pred, datum)



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

- (Object) sleep



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

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