Configuring the collection of message flow statistics by using the mqsichangeflowstats command

You can configure the collection of accounting and statistics data for your message flows by using the mqsichangeflowstats command.

Before you begin

About this task

You can configure the collection of message flow accounting and statistics data for one or more active message flows by using the mqsichangeflowstats command.

Alternatively, you can configure the statistics and accounting properties in the .yaml configuration file for your integration node or server, as described in Configuring the collection of message flow statistics by using a .yaml configuration file.

If you want to view message flow statistics by using the web user interface, you must specify JSON as one of the output formats when you configure statistics collection. You can also report the statistics to the user trace, IBM MQ, or MQTT.

Procedure

If you use the mqsichangeflowstats command to start statistics collection and specify the required output formats, the specified formats replace the output formats that were previously emitted for the message flow. The specified formats are not added to the previously emitted formats. If you start statistics collection by running the mqsichangeflowstats command without specifying an output format on the command, the statistics data is emitted to the user trace log by default.

Select the granularity of the data that you want to be collected by specifying the appropriate parameters on the mqsichangeflowstats command.

To configure the collection of message flow accounting and statistics data, complete the following steps:

  1. Identify the resource for which you want to collect statistics.
    You can collect statistics for a specific message flow, for all message flows in a specified application or library, or for all message flows on a specified integration server.
  2. Decide whether you want to collect thread-related statistics.
  3. Decide whether you want to collect node-related statistics.
    If you do, you can also collect information about terminals for the nodes.
  4. Decide whether you want to associate data collection with a particular accounting origin.
    This option is valid for snapshot and archive data, and for message flows and integration servers. However, when active, you must set its origin value in each message flow to which it refers. If you do not configure the participating message flows to set the appropriate origin identifier, the data that is collected for that message flow is collected with the origin set to Anonymous.

    For more information, see Setting message flow accounting and statistics accounting origin.

  5. Decide the target destination. You can choose multiple destinations by specifying multiple comma-separated values for the output format property.
    • User trace log (the default setting).
    • XML format publication message. If you chose this target destination, register the following topic for the subscriber:
      • For publications on an IBM MQ pub/sub broker:
        $SYS/Broker/integrationNodeName/StatisticsAccounting/recordType/integrationServerName/messageFlowLabel
      • For publications on an MQTT pub/sub broker:
        IBM/IntegrationBus/integrationNodeName/StatisticsAccounting/recordType/integrationServerName/messageFlowLabel

      where integrationNodeName, integrationServerName, and messageFlowLabel represent the integration node, integration server, and message flow on which you want to receive data. recordType is the type of data collection on which you want to receive publications (SnapShot, Archive, or the topic wildcard "+" to receive both). The value that you specify for record type is case-sensitive, so if you choose to receive snapshot data, set the record type to SnapShot.

    • JSON publication message. Register the following topic for the subscriber:
      • For publications on an IBM MQ pub/sub broker:
        $SYS/Broker/integrationNodeName/Statistics/JSON/recordType/integrationServerName/applications/application_name/libraries/library_name/messageflows/message_flow_name
      • For publications on an MQTT pub/sub broker:
        IBM/IntegrationBus/integrationNodeName/Statistics/JSON/recordType/integrationServerName/applications/application_name/libraries/library_name/messageflows/message_flow_name

      where integrationNodeName, integrationServerName, application_name, library_name, and message_flow_name represent the integration node, integration server, application, library, and message flow on which you want to receive data. The recordType is the type of data collection on which you want to receive publications (SnapShot, Archive, or the topic wildcard "+" to receive both). The value that you specify for record type is case-sensitive, so if you choose to receive snapshot data, set the record type to SnapShot.

  6. Decide the type of data collection that you want:
    • Snapshot
    • Archive
    • Snapshot and archive
  7. Run the mqsichangeflowstats command to activate or deactivate the collection of snapshot data, archive data, or both.
    For example, to turn on snapshot statistics for message flow flow2 in application app1, on the specified integration server, use the following command:
    mqsichangeflowstats -c active -s -i localhost -p 7600 -k app1 -f flow2
    To turn off archive and snapshot statistics for all message flows in all applications and libraries on the specified integration server, use the following command:
    mqsichangeflowstats -c inactive -a -s -i localhost -p 7600 -k "*" -y "*" -f "*"

    By default, the settings that you specify with this command persist when the integration server or node is restarted and when the message flow is redeployed. If you do not want the settings to persist, you can specify the --non-persist parameter. The --non-persist parameter causes the settings to remain in effect only until a restart or redeploy, at which point the settings that are specified in the server.conf.yaml or node.conf.yaml configuration file take effect.

    For more information, see mqsichangeflowstats command.

Results

When the command completes successfully, data collection for the specified resources is started:

  • If you requested snapshot data, information is collected for approximately 20 seconds, and the results are written to the output specified in the node.conf.yaml or server.conf.yaml file.
  • If you requested archive data, information is collected for the interval that is defined for the integration node or server (in the node.conf.yaml or server.conf.yaml file). The results are written to the specified output. The interval is reset and data collection starts again.

What to do next