A Monitor Rule allows you to specify which requests should be throttled and/or monetized and how TORO Integrate will throttle and/or monetize these requests. Monetization allows you to compute your API usage costs whilst throttling allows you to limit the amount of requests the server will process. Monitor Rules dictate how the Monitor Search Index will be be queried when throttling and/or monetizing requests.
A Monitor Rule is defined using the following fields:
||The Monitor Rule's identifier.|
||Describes what the Monitor Rule does.|
||Indicates if the rule is active or inactive; an inactive rule means TORO Integrate won't check matches for it.|
||Influences the order by which TORO Integrate checks matches for rules; a lower number indicates higher priority. A request may only match one rule.|
|Invokes Per Minute||false||
||The maximum number of invokes available per minute. A negative number indicates an unlimited number of invocations.|
|Invokes Per Hour||false||
||The maximum number of invokes available per hour. A negative number indicates an unlimited number of invocations.|
|Invokes Per Day||false||
||The maximum number of invokes available per day. A negative number indicates an unlimited number of invocations.|
|Invokes Per Week||false||
||The maximum number of invokes available per week. A negative number indicates an unlimited number of invocations.|
|Invokes Per Month||false||
||The maximum number of invokes available per month. A negative number indicates an unlimited number of invocations.|
|Service||false||The service to be executed when a rule is matched.|
|Cost||false||The numeric cost of a matched request. Although possible, this doesn't have to be a monetary value. This can be any number used to compute usage.|
||Possible values are
||Requires the request to be made by certain users only to match to a rule. You have the option to apply the rule to all users (
|Packages||false||Limits requests to those that invoke services from the packages listed in this field. An empty field means all packages will be checked.|
|URL Patterns||false||Specifies the URL patterns in Ant Path Notation which requests must match in order to match the particular rule. If none has been set, the Monitor Rule will be checked against all URLs.|
|Services||false||Specifies the services to be matched by the rule. If this field is left blank, all services will be matched.|
Rules have two possible date types: rolling or calendar.
Rollingdate type means TORO Integrate will subtract a minute/hour/day/week/month from the current request time and then count the number of requests from that point to present to see how many times a service has already been invoked. When checking for invokes per minute, a minute will be subtracted from the current time; invokes per hour, an hour will be subtracted; and so on. In other words, this type will check the number of invokes in the past minute/hour/day/week/month.
Calendardate type means TORO Integrate count the number of requests from the starting minute/hour/day/week/month to the present time based on the Gregorian Calendar.
Below are tables showing the expected start times when counting service invokes:
If the request was received on Saturday,
dd/MM/yyyy' 'HH:mm:ss)1, assuming that the first day of the week is Sunday:
Rolling Calendar Starting Minute
If the request was received on Thursday,
dd/MM/yyyy' 'HH:mm:ss), assuming that the first day of the week is Sunday:
Rolling Calendar Starting Minute
To manage an instance's rules, open the Throttling & Monetization dialog. To open the dialog, right click on the target instance and then click on Throttling and Monetization from the context menu.
To manage an instance's rules you can either:
- Click on the Throttling and Monetization icon on the left-hand side; or
- Right click on a blank part of the Coder Navigator, then choose Throttling and Monetization from the context menu.
Creating a Monitor Rule
To create a new Monitor Rule, open the Throttling & Monetization dialog or space and then:
- In the interface that pops up, click on the add button.
- Fill up the form.
- Click Save.
Updating a Monitor Rule
To update a Monitor Rule in Coder Studio, simply select its entry from the list of existing Monitor Rules, edit the Monitor Rule's data in the form that appears on the side, and then click Save. In Coder Cloud, the same steps apply except to access the form, you have to click the edit button in the Monitor Rule's entry.
Removing a Monitor Rule
To remove a Monitor Rule in Coder Studio, simply select its entry from the list of existing Monitor Rules, click on the delete button, and then confirm your action. In Coder Cloud, you'll have to click on the Monitor Rule entry's delete button to show the prompt.
TORO Integrate also provides REST endpoints for maintaining Monitor Rules. This API allows you to remotely do things such as:
- Search for rules
- Add or remove rules
- Enable or disable rules