Prototype
Class: Rate_limit
A rate limiter associated with one or more callers
Prototyped in:
(26.16.1-next)
Fields
Prototype
float
burst_size
[RO/constructor]
Maximum tokens that the bucket can hold
Default value:
0.
Prototyped in:
(26.16.1-next)
Prototype
Caller ref set
callers
[RO/runtime]
The set of callers attached to this rate limiter
Prototyped in:
(26.16.1-next)
Prototype
float
fill_rate
[RO/constructor]
Tokens added to the bucket per second
Default value:
0.
Prototyped in:
(26.16.1-next)
Prototype
string
name_description
[RW]
a notes field containing human-readable description
Default value:
""
Prototyped in:
(26.16.1-next)
Prototype
string
name_label
[RW]
a human-readable name
Default value:
""
Prototyped in:
(26.16.1-next)
Prototype
string
uuid
[RO/runtime]
Unique identifier/object reference
Prototyped in:
(26.16.1-next)
Messages
Hide implicit
Prototype
void
add_caller
(session ref, Rate_limit ref, Caller ref)
Attach the given caller to this rate limiter. Replaces any rate limiter previously attached to the caller.
Parameters:
session ref session_id
Reference to a valid session
Rate_limit ref self
The rate limiter
Caller ref caller
The caller to attach
Minimum role:
pool-admin
Prototyped in:
(26.16.1-next)
Prototype
Rate_limit ref
create
(session ref, Rate_limit record)
Create a new Rate_limit instance, and return its handle.
The constructor args are: name_label, name_description, burst_size, fill_rate (* = non-optional).
Parameters:
session ref session_id
Reference to a valid session
Rate_limit record args
All constructor arguments
Minimum role:
pool-admin
Result:
reference to the newly created object
Prototyped in:
(26.16.1-next)
Prototype
void
destroy
(session ref, Rate_limit ref)
Destroy the specified Rate_limit instance.
Parameters:
session ref session_id
Reference to a valid session
Rate_limit ref self
reference to the object
Minimum role:
pool-admin
Prototyped in:
(26.16.1-next)
Prototype
Rate_limit ref set
get_all
(session ref)
Return a list of all the Rate_limits known to the system.
Parameters:
session ref session_id
Reference to a valid session
Minimum role:
read-only
Result:
references to all objects
Prototyped in:
(26.16.1-next)
Prototype
(Rate_limit ref → Rate_limit record) map
get_all_records
(session ref)
Return a map of Rate_limit references to Rate_limit records for all Rate_limits known to the system.
Parameters:
session ref session_id
Reference to a valid session
Minimum role:
read-only
Result:
records of all objects
Prototyped in:
(26.16.1-next)
Prototype
float
get_burst_size
(session ref, Rate_limit ref)
Get the burst_size field of the given Rate_limit.
Parameters:
session ref session_id
Reference to a valid session
Rate_limit ref self
reference to the object
Minimum role:
read-only
Result:
value of the field
Prototyped in:
(26.16.1-next)
Prototype
Rate_limit ref set
get_by_name_label
(session ref, string)
Get all the Rate_limit instances with the given label.
Parameters:
session ref session_id
Reference to a valid session
string label
label of object to return
Minimum role:
read-only
Result:
references to objects with matching names
Prototyped in:
(26.16.1-next)
Prototype
Rate_limit ref
get_by_uuid
(session ref, string)
Get a reference to the Rate_limit instance with the specified UUID.
Parameters:
session ref session_id
Reference to a valid session
string uuid
UUID of object to return
Minimum role:
read-only
Result:
reference to the object
Prototyped in:
(26.16.1-next)
Prototype
Caller ref set
get_callers
(session ref, Rate_limit ref)
Get the callers field of the given Rate_limit.
Parameters:
session ref session_id
Reference to a valid session
Rate_limit ref self
reference to the object
Minimum role:
read-only
Result:
value of the field
Prototyped in:
(26.16.1-next)
Prototype
float
get_fill_rate
(session ref, Rate_limit ref)
Get the fill_rate field of the given Rate_limit.
Parameters:
session ref session_id
Reference to a valid session
Rate_limit ref self
reference to the object
Minimum role:
read-only
Result:
value of the field
Prototyped in:
(26.16.1-next)
Prototype
string
get_name_description
(session ref, Rate_limit ref)
Get the name/description field of the given Rate_limit.
Parameters:
session ref session_id
Reference to a valid session
Rate_limit ref self
reference to the object
Minimum role:
read-only
Result:
value of the field
Prototyped in:
(26.16.1-next)
Prototype
string
get_name_label
(session ref, Rate_limit ref)
Get the name/label field of the given Rate_limit.
Parameters:
session ref session_id
Reference to a valid session
Rate_limit ref self
reference to the object
Minimum role:
read-only
Result:
value of the field
Prototyped in:
(26.16.1-next)
Prototype
Rate_limit record
get_record
(session ref, Rate_limit ref)
Get a record containing the current state of the given Rate_limit.
Parameters:
session ref session_id
Reference to a valid session
Rate_limit ref self
reference to the object
Minimum role:
read-only
Result:
all fields from the object
Prototyped in:
(26.16.1-next)
Prototype
string
get_uuid
(session ref, Rate_limit ref)
Get the uuid field of the given Rate_limit.
Parameters:
session ref session_id
Reference to a valid session
Rate_limit ref self
reference to the object
Minimum role:
read-only
Result:
value of the field
Prototyped in:
(26.16.1-next)
Prototype
void
remove_caller
(session ref, Rate_limit ref, Caller ref)
Detach the given caller from this rate limiter
Parameters:
session ref session_id
Reference to a valid session
Rate_limit ref self
The rate limiter
Caller ref caller
The caller to detach
Minimum role:
pool-admin
Prototyped in:
(26.16.1-next)
Prototype
void
set_burst_size
(session ref, Rate_limit ref, float)
Set the burst size of the rate limiter
Parameters:
session ref session_id
Reference to a valid session
Rate_limit ref self
The rate limiter
float value
The new burst size, must be positive
Minimum role:
pool-admin
Prototyped in:
(26.16.1-next)
Prototype
void
set_fill_rate
(session ref, Rate_limit ref, float)
Set the fill rate of the rate limiter
Parameters:
session ref session_id
Reference to a valid session
Rate_limit ref self
The rate limiter
float value
The new fill rate (tokens/second), must be positive
Minimum role:
pool-admin
Prototyped in:
(26.16.1-next)
Prototype
void
set_name_description
(session ref, Rate_limit ref, string)
Set the name/description field of the given Rate_limit.
Parameters:
session ref session_id
Reference to a valid session
Rate_limit ref self
reference to the object
string value
New value to set
Minimum role:
pool-admin
Prototyped in:
(26.16.1-next)
Prototype
void
set_name_label
(session ref, Rate_limit ref, string)
Set the name/label field of the given Rate_limit.
Parameters:
session ref session_id
Reference to a valid session
Rate_limit ref self
reference to the object
string value
New value to set
Minimum role:
pool-admin
Prototyped in:
(26.16.1-next)