Class: Tracemake::Span
- Inherits:
-
Struct
- Object
- Struct
- Tracemake::Span
- Defined in:
- lib/tracemake.rb
Overview
Represents a time span for a command execution
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#pid ⇒ Object
Returns the value of attribute pid.
-
#sid ⇒ Object
Returns the value of attribute sid.
-
#start ⇒ Object
Returns the value of attribute start.
-
#stop ⇒ Object
Returns the value of attribute stop.
Instance Method Summary collapse
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command
13 14 15 |
# File 'lib/tracemake.rb', line 13 def command @command end |
#pid ⇒ Object
Returns the value of attribute pid
13 14 15 |
# File 'lib/tracemake.rb', line 13 def pid @pid end |
#sid ⇒ Object
Returns the value of attribute sid
13 14 15 |
# File 'lib/tracemake.rb', line 13 def sid @sid end |
#start ⇒ Object
Returns the value of attribute start
13 14 15 |
# File 'lib/tracemake.rb', line 13 def start @start end |
#stop ⇒ Object
Returns the value of attribute stop
13 14 15 |
# File 'lib/tracemake.rb', line 13 def stop @stop end |
Instance Method Details
#b_event ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/tracemake.rb', line 20 def b_event { "name" => name, "ph" => "B", "ts" => start * 1_000_000, "pid" => 0, "tid" => sid, "args" => { "command" => command } } end |
#e_event ⇒ Object
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/tracemake.rb', line 33 def e_event { "name" => name, "ph" => "E", "ts" => stop * 1_000_000, "pid" => 0, "tid" => sid, "args" => {} } end |
#name ⇒ Object
14 15 16 17 18 |
# File 'lib/tracemake.rb', line 14 def name _command = command _command = command[1..-1] if command[0] == "-c" _command.join(" ") end |