google-cloud-debugger - Class Google::Cloud::Debugger::RequestQuotaManager (v0.42.2)

Reference documentation and code samples for the google-cloud-debugger class Google::Cloud::Debugger::RequestQuotaManager.

RequestQuotaManager

Tracking object used by debugger agent to manage quota in request-based applications. This class tracks the amount of time and number of breakpoints to evaluation in a single session.

The debugger agent doesn't have use a quota manager by default, which means it will evaluate all breakpoints encountered and takes as much time as needed. This class is utilized by Middleware class to limit latency overhead when used in Rack-based applications.

Inherits

  • Object

Methods

#consume

def consume(time: 0)

Notify the quota manager some resource has been consumed. Each time called increases the count quota usage.

Parameter
  • time (Float) (defaults to: 0) — Amount of time to deduct from the time quota.

#count_quota

def count_quota()

The count quota for this manager

#count_quota=

def count_quota=(value)

The count quota for this manager

#count_used

def count_used()

The count quota used

#count_used=

def count_used=(value)

The count quota used

#initialize

def initialize(time_quota: DEFAULT_TIME_QUOTA, count_quota: DEFAULT_COUNT_QUOTA) -> RequestQuotaManager

Construct a new RequestQuotaManager instance

Parameters
  • time_quota (Float) (defaults to: DEFAULT_TIME_QUOTA) — The max quota for time consumed.
  • count_quota (Integer) (defaults to: DEFAULT_COUNT_QUOTA) — The max quota for count usage.
Returns

#more?

def more?() -> Boolean

Check if there's more quota left.

Returns
  • (Boolean) — True if there's more quota; false otherwise.

#reset

def reset()

Reset all the quota usage.

#time_quota

def time_quota()

The time quota for this manager

#time_quota=

def time_quota=(value)

The time quota for this manager

#time_used

def time_used()

The time quota used

#time_used=

def time_used=(value)

The time quota used

Constants

DEFAULT_TIME_QUOTA

value: 0.05
Default Total time allowed to consume, in seconds

DEFAULT_COUNT_QUOTA

value: 10
Default max number of breakpoints to evaluate