Class: Hoss::Event Private
- Inherits:
-
Object
- Object
- Hoss::Event
- Extended by:
- Forwardable
- Includes:
- ChildDurations::Methods
- Defined in:
- lib/hoss/event.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Defined Under Namespace
Classes: Error, Request, Response
Constant Summary collapse
- DEFAULT_TYPE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'custom'
Instance Attribute Summary collapse
-
#error ⇒ Object
private
rubocop:enable Metrics/ParameterLists.
-
#filtered ⇒ Object
private
rubocop:enable Metrics/ParameterLists.
- #id ⇒ Object readonly private
-
#request ⇒ Object
private
rubocop:enable Metrics/ParameterLists.
-
#response ⇒ Object
private
rubocop:enable Metrics/ParameterLists.
Instance Method Summary collapse
- #done(clock_end: Util.monotonic_micros) ⇒ Object private
-
#initialize ⇒ Event
constructor
private
rubocop:disable Metrics/ParameterLists.
-
#inspect ⇒ Object
private
relations.
- #running? ⇒ Boolean private
-
#start(clock_start = Util.monotonic_micros) ⇒ Object
private
life cycle.
- #started? ⇒ Boolean private
- #stop(clock_end = Util.monotonic_micros) ⇒ Object private
- #stopped? ⇒ Boolean private
Methods included from ChildDurations::Methods
#child_durations, #child_started, #child_stopped
Constructor Details
#initialize ⇒ Event
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
rubocop:disable Metrics/ParameterLists
72 73 74 75 76 77 78 |
# File 'lib/hoss/event.rb', line 72 def initialize @id = SecureRandom.uuid @request = Request.new # @response = Response.new @filtered = false @retries = 0 end |
Instance Attribute Details
#error ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
rubocop:enable Metrics/ParameterLists
81 82 83 |
# File 'lib/hoss/event.rb', line 81 def error @error end |
#filtered ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
rubocop:enable Metrics/ParameterLists
81 82 83 |
# File 'lib/hoss/event.rb', line 81 def filtered @filtered end |
#id ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
89 90 91 |
# File 'lib/hoss/event.rb', line 89 def id @id end |
#request ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
rubocop:enable Metrics/ParameterLists
81 82 83 |
# File 'lib/hoss/event.rb', line 81 def request @request end |
#response ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
rubocop:enable Metrics/ParameterLists
81 82 83 |
# File 'lib/hoss/event.rb', line 81 def response @response end |
Instance Method Details
#done(clock_end: Util.monotonic_micros) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
107 108 109 110 |
# File 'lib/hoss/event.rb', line 107 def done(clock_end: Util.monotonic_micros) stop clock_end self end |
#inspect ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
relations
126 127 128 129 |
# File 'lib/hoss/event.rb', line 126 def inspect "<Hoss::Event id:#{id.inspect}" \ '>' end |
#running? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
120 121 122 |
# File 'lib/hoss/event.rb', line 120 def running? started? && !stopped? end |
#start(clock_start = Util.monotonic_micros) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
life cycle
95 96 97 98 99 |
# File 'lib/hoss/event.rb', line 95 def start(clock_start = Util.monotonic_micros) @timestamp = Util.micros @clock_start = clock_start self end |
#started? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
116 117 118 |
# File 'lib/hoss/event.rb', line 116 def started? !! end |
#stop(clock_end = Util.monotonic_micros) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
101 102 103 104 105 |
# File 'lib/hoss/event.rb', line 101 def stop(clock_end = Util.monotonic_micros) @duration ||= (clock_end - @clock_start) @self_time = @duration - child_durations.duration self end |
#stopped? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
112 113 114 |
# File 'lib/hoss/event.rb', line 112 def stopped? !!duration end |