Skip to content

Home

Introduction

Development

Overview

IDEs

Services

Service manager

API Explorer

Monitor rules

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.

Properties

A monitor rule is defined using the following fields:

Name Required Default Value Description
Name true "New Rule" The monitor rule's identifier.
Description true "New Rule" Describes what the monitor rule does.
Enabled false false Indicates if the rule is active or inactive; an inactive rule means TORO Integrate won't check matches for it.
Priority true 0 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 -1 The maximum number of invokes available per minute. A negative number indicates an unlimited number of invocations.
Invokes Per Hour false -1 The maximum number of invokes available per hour. A negative number indicates an unlimited number of invocations.
Invokes Per Day false -1 The maximum number of invokes available per day. A negative number indicates an unlimited number of invocations.
Invokes Per Week false -1 The maximum number of invokes available per week. A negative number indicates an unlimited number of invocations.
Invokes Per Month false -1 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.
Date Type true Rolling Possible values are Rolling and Calendar.
Users true Everyone 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 (Everyone), to certain Integrate users only (excluding Marketplace users), or only to anonymous users only (those not logged in).
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.

Date types

Rules have two possible date types: rolling or calendar.

  • A rolling date 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.
  • A calendar date type means TORO Integrate will 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, 04/07/2015 05:43:42 (dd/MM/yyyy' 'HH:mm:ss)1, assuming that the first day of the week is Sunday:

    Rolling Calendar
    Starting Minute 04/07/2015 05:42:42 04/07/2015 05:43:00
    Starting Hour 04/07/2015 04:43:42 04/07/2015 05:00:00
    Starting Day 03/07/2015 05:43:42 04/07/2015 00:00:00
    Starting Week 27/06/2015 05:43:42 28/06/2015 00:00:00
    Starting Month 04/06/2015 05:43:42 01/07/2015 00:00:00
  • If the request was received on Thursday, 16/04/2015 22:45:49 (dd/MM/yyyy' 'HH:mm:ss), assuming that the first day of the week is Sunday:

    Rolling Calendar
    Starting Minute 16/04/2015 22:44:49 16/04/2015 22:45:00
    Starting Hour 16/04/2015 21:45:49 16/04/2015 22:00:00
    Starting Day 15/04/2015 22:45:49 16/04/2015 00:00:00
    Starting Week 09/04/2015 22:45:49 12/04/2015 00:00:00
    Starting Month 16/03/2015 22:45:49 01/04/2015 00:00:00

Viewing monitor rules

To view an instance's rules, open the Throttling & Monetization dialog. To open the dialog, right click on the target instance and then click Throttling and Monetization from the context menu. In Coder Cloud, you can also access this dialog from the main navigation menu.

Accessing the Throttling & Monetization dialog

Accessing the throttling & Monetization dialog

Manage monitor rules via REST API

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

Creating a monitor rule

To create a new monitor rule, open the Throttling & Monetization dialog and then:

  1. In the interface that pops up, click on the green, '+' button.
  2. Fill up the form.
  3. Click Save or OK.

Creating a monitor rule

  1. In the interface that pops up, click on the Add Rule button.
  2. Fill up the form.
  3. Click Save.

Creating a monitor rule

Updating a monitor rule

To update a monitor rule in Coder Studio, select its entry from the list of existing Monitor rules and 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, select its entry from the list of existing monitor rules, click on the red 'x' 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.


  1. See patterns in SimpleDateFormat