Throttling
Some plugins call external providers that embedded API limitations. Because some plugins have trouble handling errors when limits are reached, we may want to reduce plugin calls before reaching those limits.
Using Throttlings, you can limit usage of a given plugin version, in 3 different ways :
Rate limit : you can limit the number of calls by second, by using
max_qps
field.Concurrency : you can limit the number of simultaneous calls, by using
max_concurrency
field.Timeout : you can define a maximum duration for the calls, by using
timeout_qps
field.
You have to define at least one of those restrictions.
Throttling can be defined at 4 different levels :
GLOBAL
CONTAINER
ORGANISATION
DATAMART
You can define a Throttling using this route :
Create a throttling
POST
https://api.mediarithmics.com/v1/plugins/:plugin_id/versions/:version_id/throttlings
Request Body
Name | Type | Description |
---|---|---|
scope* | String | Define the application scope of the Throttling. Possible values : GLOBAL, CONTAINER, DATAMART or ORGANISATION. |
plugin_version_id* | String | The ID of the plugin version. |
throttling_key | String | Is equals to the datamart id if the scope is DATAMART or the organisation id if the scope is ORGANISATION. |
max_concurrency | Integer | The maximum number of simultaneous calls to the end_point. |
max_qps | Double | The maximum number of calls to the end_point by second. It can be decimal, 0.5 means : maximum 1 call every 2 seconds. |
plugin_endpoint* | String | The plugin routes affected by this throttling. Exemple : |
timeout_ms | Integer | The call to the endpoint is killed if it lasts more than this duration (in ms). |
You can list, delete or update Throttlings by using thoses routes :
Get throttlings for the Plugin Version
GET
https://api.mediarithmics.com/v1/plugins/:plugin_id/versions/:version_id/throttlings
Delete a throttling
DELETE
https://api.mediarithmics.com/v1/plugins/:plugin_id/versions/:version_id/throttlings/:throttling_id
Update a throttling
PUT
https://api.mediarithmics.com/v1/plugins/:plugin_id/versions/:version_id/throttlings/:throttling_id
Request Body
Name | Type | Description |
---|---|---|
scope* | String | Define the application scope of the Throttling. Possible values : GLOBAL, CONTAINER, DATAMART or ORGANISATION. |
throttling_key | String | Is equals to the datamart id if the scope is DATAMART or the organisation id if the scope is ORGANISATION. |
max_concurrency | Integer | The maximum number of simultaneous calls to the end_point. |
max_qps | Double | The maximum number of calls to the end_point by second. It can be decimal, 0.5 means : maximum 1 call every 2 seconds. |
plugin_endpoint* | String | The plugin routes affected by this throttling. Exemple : |
timeout_ms | Integer | The call to the endpoint is killed if it lasts more than this duration (in ms). |
Last updated