Monitoring executions with IBM License Metric Tool

When you use the execution Java™™ API, you must use IBM® License Metric Tool (ILMT) to monitor decision service execution.

For more information about IBM License Metric Tool, see IBM License Metric Tool information External link opens a new window or tab.

The number of fully executed decision services must be measured by IBM License Metric Tool to check whether the number exceeds the authorized maximum number of executions.

The architecture of the IBM License Metric Tool monitoring is composed of three main components:
  • A client inside the execution Java API that connects to a decision usage metering service. You must configure the client to enable monitoring by IBM License Metric Tool, and to connect the client to the decision usage metering service.
  • A decision usage metering service that registers a subscription from each node on which the execution Java API is running. Then, the bridge receives the count for executed decision services regularly, and buffers it in memory and database. After a certain period, these metrics are stored in an XML file that is readable by the IBM License Metric Tool scanners.
  • IBM License Metric Tool reads the generated XML files on each node, and exposes it as a report on its administration console. The metric name to check is MONTHLY_API_CALL.
Consumption entitlement for executing decision services in pure Java environment

Parameters

The following parameters are used to configure the decision usage metering service client:
Table 1. Decision usage metering service client configuration parameters
Parameter Description Default value
Decision usage metering service URI The base URI to connect to the decision usage metering service. Mandatory value
Instance identifier The instance identifier of the execution Java API that is installed on a specific node of a cluster. This identifier must start with the '/' character. Mandatory value
Flush interval The period between the metrics that are sent to the bridge. The value is in number of seconds. 300 seconds
SSL context The SSL context provided by the user to connect securely the execution Java API to the decision usage metering service. The default SSL context of the execution Java API.
Connection timeout The client connection timeout to connect to the decision usage metering service. By default, the timeout is infinite.

Sample

Check the following sample that executes a decision service and enables the monitoring with IBM License Metric Tool:
import myModel.Borrower;
import myModel.Loan;
import samples.LoanValidation.LoanValidationOutput;
import samples.LoanValidation.loanValidation.Input;

private static long flushInterval = 60L;

[..]

ILMTConfiguration configuration = new ILMTConfiguration.Builder()
            .withConnectionTimeout(10)
            .withFlushInterval(flushInterval)
            .withILMTBridgeURI(new URI("http://localhost:8888"))
            .withInstanceIdentifier("/myInstanceIdentifier")
            .build();

DecisionRunnerProvider provider = new ClassLoaderDecisionRunnerProvider.Builder().enableMetering(configuration).build();

DecisionRunner runner = provider.getDecisionRunner("LoanValidation");

Input in = new Input();

Borrower borrower = new Borrower();
borrower.setZipCode("12345");
borrower.setCreditScore(700);
borrower.setFirstName("John");
borrower.setLastName("Doe");
borrower.setYearlyIncome(100000);
in.borrower = borrower;

Loan loan = new Loan();
loan.setAmount(185000);
loan.setNumberOfMonthlyPayments(72);
in.loan = l;
         
LoanValidationOutput out = (LoanValidationOutput) runner.execute(in);

Get the swidtag file (ibm.com_IBM_Automation_Decision_Services-25.0.0.swidtag) from <DECISION_DESIGNER_SERVER_URL>/download/, and rename it to ibm.com_IBM_Automation_Decision_Services.swidtag. Finally, add it to the application classloader.

Configuring the usage metering service

The usage metering service produces license files that are compliant with IBM License Metric Tool.

Information about the usage metering service for the execution Java API is available on the following GitHub repository: https://github.com/DecisionsDev/decisions-metering External link opens a new window or tab.