Enabling usage metering

You can use the res-setup Ant task to configure each artifact for which you want to enable metering.

Before you begin

Read res-setup to get familiar with the res-setup Ant task.

About this task

The metering parameters are described in res-setup.You can enable the IBM Cloud Product Insights feature for the following Decision Server runtime features in a J2SE environment on a Liberty app server:
  • Hosted Transparent Decision Service
  • J2SE execution
  • Testing and simulation

Procedure

  1. Here is how to run res-setup to enable metering for the following Decision Server runtime features.
    Note: <api_key> in the following code examples is the key used for the connection between your IBM Cloud Product Insights service instance on Bluemix and your IBM ODM server. You can find it in your service instance under Service Credentials > View Credentials.
    Hosted Transparent Decision Service
    The following example script generates a new DecisionService.war file with the IBM Cloud Product Insights feature enabled.
    cd <odm_install_dir>/executionserver/bin
    <odm_install_dir>/shared/tools/ant/bin/ant -f ressetup.xml -Dmetering.war.in=../applicationservers/WLP855/DecisionService.war -Dmetering.war.out=DecisionServiceMetering.war -Dmetering.api.key=<api_key> -Dmetering.install.directory=/opt/IBM/MyServer/ODMRuntime -Dmetering.instance.identifier=DecisionService setup-metering
    J2SE execution
    The following example script generates a new ra.xml file with the IBM Cloud Product Insights feature enabled.
    cd <odm_install_dir>/executionserver/bin
    <odm_install_dir>/shared/tools/ant/bin/ant -f ressetup.xml -Dxu.config.in=ra.xml -Dxu.config.out=ra-out.xml -Dmetering.api.key=<api_key> -Dmetering.install.directory=/opt/IBM/MyServer/ODMRuntime -Dmetering.instance.identifier=J2SE setup-metering

    A new ra-out.xml file is generated. The metering feature is enabled.

    <config-property>
    <config-property-name>plugins</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>{pluginClass=DVS},{pluginClass=Metering,enable=true,server.url=https://hybridconnect-api.ng.bluemix.net,send.usages=true,api.key=<api_key>,install.directory=/opt/IBM/MyServer/ODMRuntime,instance.identifier=J2SE} }</config-property-value>
    </config-property>
    Testing and simulation
    The following example script generates a new DecisionRunner.war file with the IBM Cloud Product Insights feature enabled.
    cd <odm_install_dir>/executionserver/bin
    <odm_install_dir>/shared/tools/ant/bin/ant -f ressetup.xml -Dmetering.war.in=../applicationservers/WLP855/DecisionRunner.war -Dmetering.war.out=DecisionRunnerMetering.war -Dmetering.api.key=<api_key> -Dmetering.install.directory=/opt/IBM/MyServer/ODMRuntime -Dmetering.instance.identifier=DecisionRunner setup-metering

    The following example script generates a new testing.war file with the IBM Cloud Product Insights feature enabled.

    cd <odm_install_dir>/executionserver/bin
    <odm_install_dir>/shared/tools/ant/bin/ant -f ressetup.xml -Dmetering.war.in=../applicationservers/WLP855/testing.war -Dmetering.war.out=testingOut.war -Dmetering.api.key=<api_key> -Dmetering.install.directory=/opt/IBM/MyServer/ODMRuntime -Dmetering.instance.identifier=testing setup-metering
  2. Deploy the generated output file to your Liberty application server, and then restart the server.
  3. Go to Bluemix and check out usage results in your IBM Cloud Product Insights service dashboard.

    For details on the usage metrics, see IBM ODM metrics.