Exception: Gitlab::GitalyClient::TooManyInvocationsError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/gitlab/gitaly_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(call_site, invocation_count, max_call_stack, most_invoked_stack) ⇒ TooManyInvocationsError

Returns a new instance of TooManyInvocationsError.


14
15
16
17
18
19
20
21
22
23
24
# File 'lib/gitlab/gitaly_client.rb', line 14

def initialize(call_site, invocation_count, max_call_stack, most_invoked_stack)
  @call_site = call_site
  @invocation_count = invocation_count
  @max_call_stack = max_call_stack
  stacks = most_invoked_stack.join('\n') if most_invoked_stack

  msg = "GitalyClient##{call_site} called #{invocation_count} times from single request. Potential n+1?"
  msg = "#{msg}\nThe following call site called into Gitaly #{max_call_stack} times:\n#{stacks}\n" if stacks

  super(msg)
end

Instance Attribute Details

#call_siteObject (readonly)

Returns the value of attribute call_site


12
13
14
# File 'lib/gitlab/gitaly_client.rb', line 12

def call_site
  @call_site
end

#invocation_countObject (readonly)

Returns the value of attribute invocation_count


12
13
14
# File 'lib/gitlab/gitaly_client.rb', line 12

def invocation_count
  @invocation_count
end

#max_call_stackObject (readonly)

Returns the value of attribute max_call_stack


12
13
14
# File 'lib/gitlab/gitaly_client.rb', line 12

def max_call_stack
  @max_call_stack
end