Skip to content

Toro Cloud Dev Center


MonitorFunctions

The Monitor class contains functions for managing monitor rules, searching invoke documents, and getting monetization summaries. Functions from this class can be used in both Gloop or Groovy code.

deleteMonitorRule

The Monitor.deleteMonitorRule(String) function is used to delete a monitor rule.

Parameters

Property Type Description
name java.lang.String Name of the rule to delete

Usage

Sample service showing how to use the `deleteMonitorRule(String)` function of `MonitorFunctions`

saveMonitorRule

The Monitor.saveMonitorRule(MonitorRuleMetadata) function is used to save a monitor rule.

Parameters

Property Type Description
rule io.toro.martini.monitor.MonitorRuleMetadata Monitor rule to save

Usage

Sample service showing how to use the `saveMonitorRule(io.toro.martini.monitor.MonitorRuleMetadata)` function of `MonitorFunctions`

disableMonitorRule

The Monitor.disableMonitorRule(String) function is used to disable a monitor rule.

Parameters

Property Type Description
name java.lang.String Name of the rule to disable

Usage

Sample service showing how to use the `disableMonitorRule(String)` function of `MonitorFunctions`

enableMonitorRule

The Monitor.enableMonitorRule(String) function is used to enable a monitor rule.

Parameters

Property Type Description
name java.lang.String Name of the rule to enable

Usage

Sample service showing how to use the `enableMonitorRule(String)` function of `MonitorFunctions`

getMonitorRules

The Monitor.getMonitorRules(...) function is used to get a list of monitor rules. There are two variations of this function that can be used:

  • MartiniFunctions.getMonitorRules()
  • MartiniFunctions.getMonitorRules(boolean)
  • MartiniFunctions.getMonitorRules(int, int, boolean)

Parameters

Property Type Description
page java.lang.Integer Page number in pagination
size java.lang.Integer The maximum number of monitor rules to return
enabled java.lang.Boolean If true, only monitor rules that are enabled will be returned

Return value

Property Type Description
monitorRulesMetadata io.toro.martini.monitor.MonitorRuleMetadata[] Array of existing monitor rules

Usage

Sample service showing how to use the `getMonitorRules()` function of `MonitorFunctions`

getMonitorRule

The Monitor.getMonitorRule(String) function is used to get a monitor rule.

Parameters

Property Type Description
name java.lang.String The name of the monitor rule to get

Return value

Property Type Description
monitorRuleMetadata io.toro.martini.monitor.MonitorRuleMetadata The retrieved monitor rule

Usage

Sample service showing how to use the `getMonitorRule(String)` function of `MonitorFunctions`

getMonetizationBill

The Monitor.getMonetizationBill(InvokeDocumentQuery) function is used to get a bill summary based on a provided query.

Parameters

Property Type Description
query io.toro.martini.monitor.InvokeDocumentQuery Query selecting the documents to calculate the cost of

Return value

Property Type Description
monetizationBill io.toro.martini.monitor.MonetizationBill The summarized bill that matches the query

Usage

Sample service showing how to use the `getMonetizationBill(InvokeDocumentQuery)` function of `MonitorFunctions`

searchMonitor

The Monitor.searchMonitor(...) function is used to get a monitor rule.

Parameters

Property Type Description
query java.lang.String Solr query to be performed
id java.lang.String ID of the document to retrieve
trackerId java.lang.String[] Tracker ID of the document(s) to find
packageName java.lang.String[] Package name of the document(s) to find
serviceName java.lang.String[] Service name of the document(s) to find
user java.lang.String[] User of the document(s) to find
userGroups java.lang.String[] User groups of the document(s) to find
endpointName java.lang.String[] Endpoint name of the document(s) to find
endpointType java.lang.String[] Endpoint type of the document(s) to find
url java.lang.String[] URL of the document(s) to find
remoteAddress java.lang.String[] Remote address of the document(s) to find
country java.lang.String[] Country of the document(s) to find
location java.lang.String[] Location of the document(s) to find
success java.lang.Boolean Boolean value indicating whether the documents' corresponding operation has been successful
fromResponseTime java.lang.Long Display document(s) containing response time from (minimum) this long value. The long value is represented in millisecond.
toResponseTime java.lang.Long Display document(s) containing response time to (maximum) this long value. The long value is represented in millisecond.
fromDate java.util.Date Display document(s) containing a timestamp from this date
toDate java.util.Date Display document(s) containing a timestamp to this date
minCost java.lang.Double Minimum cost of document(s) to find
maxCost java.lang.Double Maximum cost of document(s) to find
pageSize java.lang.Integer Number of results to display in a page
page java.lang.Integer Page number of results to display

Return value

Property Type Description
searchResult io.toro.martini.monitor.SearchResult Results derived from the query

Usage

Sample service showing how to use the `searchMonitor(...)` function of `MonitorFunctions`