Show memory statistics by using REST Monitoring APIs

Purpose

Reports memory statistics for IBM® IoT MessageSight.

URI

Use the IBM IoT MessageSight REST API GET method with the following IBM IoT MessageSight monitoring URI:

http://<admin-endpoint-IP:Port>/ima/v1/monitor/Memory

Object configuration data

Provide query parameters requesting the statistics that you want returned in the JSON payload. The following example uses cURL to create memory-related statistics:
curl -X GET http://127.0.0.1:9089/ima/v1/monitor/Memory?SubType=SubType%26Duration=Duration%26StatType=StatType
SubType
Specifies the time period of data to report.
This value can be one of the following values:
  • Current
    View the most recent statistics.
  • History
    View older statistics.
The default value is Current.
Duration
Optional.
Specifies the time span (in seconds) of the data to be collected.

Valid value range is 1 - 86400.

The default value is 1800.

StatType
Specifies the types of data to return when SubType is set to History.
You can specify multiple values in a comma delimited list. This value can be one of the following values:
  • MemoryTotalBytes
    This statistic shows the total amount of physical memory.
  • MemoryFreeBytes
    This statistic shows the amount of physical memory that is available.
  • MemoryFreePercent
    This statistic shows the amount of free memory as a percentage of total physical memory.
  • ServerVirtualMemoryBytes
    This statistic shows the amount of virtual memory that is being used.
  • ServerResidentSetBytes
    This statistic shows the amount of physical memory that is being used.
  • MessagePayloads
    This statistic shows the amount of memory that is being consumed for message payloads.
  • PublishSubscribe
    This statistic shows the amount of memory that is being consumed for publish/subscribe data structures. For example, topics and subscriptions.
  • Destinations
    This statistic shows the amount of memory that is being consumed for destinations on which messages can be buffered. For example, queues.
  • CurrentActivity
    This statistic shows the amount of memory that is being consumed for current activity. For example, sessions, transactions and message acknowledgments.
  • ClientStates
    This statistic shows the amount of memory that is being consumed for connected and disconnected clients.

The default value is MemoryTotalBytes.

Usage Notes

  • The command must be capitalized as shown.
  • The command must use the double quotation marks as shown.
  • If the SubType is set to History, and monitoring data is not available for the requested statistic, a value of -1 is returned.
  • The output shows the following fields:
    MemoryTotalBytes
    Shows the total amount of physical memory.
    MemoryFreeBytes
    Shows the amount of physical memory that is available.
    MemoryFreePercent
    Shows the amount of free memory as a percentage of the total physical memory.
    ServerVirtualMemoryBytes
    Shows the amount of virtual memory that is being used by IBM IoT MessageSight.
    ServerResidentSetBytes
    Shows the amount of physical memory that is being used by IBM IoT MessageSight.
    MessagePayloads
    Shows the amount of memory in bytes that is being used by IBM IoT MessageSight for message payloads.
    PublishSubscribe
    Shows the amount of memory in bytes that is being used by IBM IoT MessageSight for publish/subscribe data.
    Destinations
    Shows the amount of memory in bytes that is being used by IBM IoT MessageSight for destinations on which messages can be buffered.
    CurrentActivity
    Shows the amount of memory in bytes that is being used by IBM IoT MessageSight for current activity.
    ClientStates
    Shows the amount of memory that is being consumed by IBM IoT MessageSight for connected and disconnected clients.

Example

The following example uses cURL to show how a GET method is used to view statistical information about the IBM IoT MessageSight volatile memory.

curl -X GET http://127.0.0.1:9089/ima/v1/monitor/Memory?SubType=Current  
 
 

The following example shows a successful example response to the GET method that was used to create statistical information about the IBM IoT MessageSight volatile memory:


{ "Version":"v1", "Memory": { "MemoryTotalBytes":7934193664, "MemoryFreeBytes":5428342784, "MemoryFreePercent":68, 
"ServerVirtualMemoryBytes":2334150656, "ServerResidentSetBytes":795844608, "MessagePayloads":1048576, "PublishSubscribe":9961472, 
"Destinations":6299616, "CurrentActivity":3149808 , "ClientStates":524288 } }