google-cloud-debugger - Class Google::Cloud::Debugger::RequestQuotaManager (v0.42.2)
Stay organized with collections
Save and categorize content based on your preferences.
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
defconsume(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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# google-cloud-debugger - Class Google::Cloud::Debugger::RequestQuotaManager (v0.42.2)\n\nReference documentation and code samples for the google-cloud-debugger class Google::Cloud::Debugger::RequestQuotaManager.\n\nRequestQuotaManager\n-------------------\n\nTracking object used by debugger agent to manage quota in\nrequest-based applications. This class tracks the amount of time\nand number of breakpoints to evaluation in a single session.\n\nThe debugger agent doesn't have use a quota manager by default, which\nmeans it will evaluate all breakpoints encountered and takes as much\ntime as needed. This class is utilized by\n[Middleware](/ruby/docs/reference/google-cloud-debugger/latest/Google-Cloud-Debugger-Middleware \"Google::Cloud::Debugger::Middleware (class)\") class to limit latency overhead\nwhen used in Rack-based applications. \n\nInherits\n--------\n\n- Object\n\nMethods\n-------\n\n### #consume\n\n def consume(time: 0)\n\nNotify the quota manager some resource has been consumed. Each time\ncalled increases the count quota usage. \n**Parameter**\n\n- **time** (Float) *(defaults to: 0)* --- Amount of time to deduct from the time quota.\n\n### #count_quota\n\n def count_quota()\n\nThe count quota for this manager\n\n### #count_quota=\n\n def count_quota=(value)\n\nThe count quota for this manager\n\n### #count_used\n\n def count_used()\n\nThe count quota used\n\n### #count_used=\n\n def count_used=(value)\n\nThe count quota used\n\n### #initialize\n\n def initialize(time_quota: DEFAULT_TIME_QUOTA, count_quota: DEFAULT_COUNT_QUOTA) -\u003e RequestQuotaManager\n\nConstruct a new RequestQuotaManager instance \n**Parameters**\n\n- **time_quota** (Float) *(defaults to: DEFAULT_TIME_QUOTA)* --- The max quota for time consumed.\n- **count_quota** (Integer) *(defaults to: DEFAULT_COUNT_QUOTA)* --- The max quota for count usage. \n**Returns**\n\n- ([RequestQuotaManager](./Google-Cloud-Debugger-RequestQuotaManager)) --- a new instance of RequestQuotaManager\n\n### #more?\n\n def more?() -\u003e Boolean\n\nCheck if there's more quota left. \n**Returns**\n\n- (Boolean) --- True if there's more quota; false otherwise.\n\n### #reset\n\n def reset()\n\nReset all the quota usage.\n\n### #time_quota\n\n def time_quota()\n\nThe time quota for this manager\n\n### #time_quota=\n\n def time_quota=(value)\n\nThe time quota for this manager\n\n### #time_used\n\n def time_used()\n\nThe time quota used\n\n### #time_used=\n\n def time_used=(value)\n\nThe time quota used\n\nConstants\n---------\n\n### DEFAULT_TIME_QUOTA\n\n**value:** 0.05 \nDefault Total time allowed to consume, in seconds\n\n### DEFAULT_COUNT_QUOTA\n\n**value:** 10 \nDefault max number of breakpoints to evaluate"]]