Class: Sleuth::Transaction

Inherits:
Struct
  • Object
show all
Defined in:
lib/sleuth/transaction.rb

Constant Summary collapse

@@running =
{}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



2
3
4
# File 'lib/sleuth/transaction.rb', line 2

def id
  @id
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



2
3
4
# File 'lib/sleuth/transaction.rb', line 2

def name
  @name
end

#parentObject

Returns the value of attribute parent

Returns:

  • (Object)

    the current value of parent



2
3
4
# File 'lib/sleuth/transaction.rb', line 2

def parent
  @parent
end

#pidObject

Returns the value of attribute pid

Returns:

  • (Object)

    the current value of pid



2
3
4
# File 'lib/sleuth/transaction.rb', line 2

def pid
  @pid
end

#stampObject

Returns the value of attribute stamp

Returns:

  • (Object)

    the current value of stamp



2
3
4
# File 'lib/sleuth/transaction.rb', line 2

def stamp
  @stamp
end

Class Method Details

.create(name, parent) ⇒ Object



6
7
8
9
# File 'lib/sleuth/transaction.rb', line 6

def self.create(name, parent)
  id = Sleuth.current_id
  running[id] = new(name, id, Time.now.to_i, Process.pid, parent)
end

Instance Method Details

#full_nameObject



11
12
13
# File 'lib/sleuth/transaction.rb', line 11

def full_name
  "#{name}-#{id}-#{stamp}-#{pid}"
end