Show topic related statistics by using REST Monitoring APIs
Purpose
Reports topic-related monitoring data for topics that have been defined in topic monitors.URI
Use the Eclipse Amlen REST API GET method with the following Eclipse Amlen monitoring URI:http://<admin-endpoint-IP:Port>/ima/v1/monitor/Topic
Object configuration data
Provide query parameters requesting the
statistics that you want returned in the JSON payload. The following example uses cURL to create
topic-related
statistics:
Where:curl -X GET http://127.0.0.1:9089/ima/v1/monitor/Topic?TopicString=TopicString%26ResultCount=ResultCount%26Monitoring-DataType=Monitoring-DataType
-
- TopicString
- Optional.
-
- ResultCount
- Optional.
-
- Monitoring-DataType
- Optional.
Usage Notes
- The command must be capitalized as shown.
- The command must use the double quotation marks as shown.
- The statistics that are produced can be up to 60 seconds out of date.
- Before you can monitor a topic, you must create a topic monitor that specifies the topic string that you want to monitor. After you create the topic monitor, statistics about the topic string are recorded. You can create topic monitors by using REST Monitoring APIs. For more information about creating topic monitors, see Viewing topic monitoring statistics by using REST Monitoring APIs.
- If the Eclipse Amlen server is restarted, monitored topic data is reset.
- To reset the monitoring data for a particular topic string, you must delete and re-create the topic monitor.
- The following fields are returned:
-
- TopicString
- String
-
- Subscriptions
- Numeric
-
- ResetTime
- Date/Time
-
- PublishedMsgs
- Numeric
-
- RejectedMsgs
- Numeric
-
- FailedPublishes
- Numeric
-
Example
The following example uses cURL to show how a GET method is used to create statistics about topics with the highest number of published messages:
curl -X GET http://127.0.0.1:9089/ima/v1/monitor/Topic?TopicString=*%26Monitoring-DataType=PublishedMsgsHighest
The following example shows a successful example response to the GET method that was used to create statistics about topics with the highest number of published messages::
{ "Version":"v1", "Topic": [ { "TopicString":"ROOT/#","Subscriptions":5,"ResetTime":"0","PublishedMsgs":50,
"RejectedMsgs":4,"FailedPublishes":2,"ResultCount":10 } ] }