Class: Gitlab::Utils::ExecutionTracker

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/utils/execution_tracker.rb

Constant Summary collapse

MAX_RUNTIME =
60.seconds
ExecutionTimeOutError =
Class.new(StandardError)

Instance Method Summary collapse

Constructor Details

#initializeExecutionTracker

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

Returns:

  • (Boolean)


16
17
18
# File 'lib/gitlab/utils/execution_tracker.rb', line 16

def over_limit?
  monotonic_time - start_time >= MAX_RUNTIME
end