Class: Gitlab::Utils::ExecutionTracker
- Inherits:
-
Object
- Object
- Gitlab::Utils::ExecutionTracker
- Defined in:
- lib/gitlab/utils/execution_tracker.rb
Constant Summary collapse
- MAX_RUNTIME =
60.seconds
- ExecutionTimeOutError =
Class.new(StandardError)
Instance Method Summary collapse
-
#initialize ⇒ ExecutionTracker
constructor
A new instance of ExecutionTracker.
- #over_limit? ⇒ Boolean
Constructor Details
#initialize ⇒ ExecutionTracker
Returns a new instance of ExecutionTracker.
12 13 14 |
# File 'lib/gitlab/utils/execution_tracker.rb', line 12 def initialize @start_time = monotonic_time end |
Instance Method Details
#over_limit? ⇒ Boolean
16 17 18 |
# File 'lib/gitlab/utils/execution_tracker.rb', line 16 def over_limit? monotonic_time - start_time >= MAX_RUNTIME end |