Module sprotector_server

Server for storing the ask and ask_r queue min, max and drop probabilities for overload protection and short circuiting for a process with sprotector.

Behaviours: gen_server.

Description

Server for storing the ask and ask_r queue min, max and drop probabilities for overload protection and short circuiting for a process with sprotector.

Function Index

change/6Change the queue minimum to Min and maximum to Max, and update the queue length to Len and the drop probabilities to AskDrop and AskRDrop.
register/3Register the local process Pid with the server with minimum message queue length Min and maximum message queue length Max.
unregister/1Unregister the process Pid with the server.
update/4Update the queue length (Len), and ask and ask_r drop probabilities (AskDrop and AskRDrop) for Pid.

Function Details

change/6

change(Pid, Min, Max, Len, AskDrop, AskRDrop) -> Result

Change the queue minimum to Min and maximum to Max, and update the queue length to Len and the drop probabilities to AskDrop and AskRDrop.

This function is an atomic. Returns true if the values were changed/updated, or false if Pid is not registered with the server.

register/3

register(Pid, Min, Max) -> Result

Register the local process Pid with the server with minimum message queue length Min and maximum message queue length Max. Lookup requests with sprotector will drop requests when above Max or with probabilities set by update/4 if above Min.

Returns true if the process is successfully registered, or false if already registered.

A process must be registered to use update/4. Initial length and drop probabilites are set to 0 and 0.0. The server will synchronously link to the Pid.

unregister/1

unregister(Pid) -> true

Unregister the process Pid with the server.

The server will synchronously unlink from Pid.

update/4

update(Pid, Len, AskDrop, AskRDrop) -> Result

Update the queue length (Len), and ask and ask_r drop probabilities (AskDrop and AskRDrop) for Pid.

Len must be an integer greater than or equal to 0.

AskDrop and AskRDrop should be floats, values below 0.0 are rounded to 0.0 and above 1.0 to 1.0.

Returns true if the values were updated, or false if Pid is not registered with the server.


Generated by EDoc, Sep 29 2016, 17:17:28.