Show connection level statistics by using REST Monitoring APIs
Purpose
Reports connection level monitoring data based on predefined queries.URI
Use the Eclipse Amlen REST API GET method with the following Eclipse Amlen monitoring URI:
http://<admin-endpoint-IP:Port>/ima/v1/monitor/Connection
Object configuration data
Provide query parameters requesting the statistics that you want returned in the JSON payload. The following example uses cURL to create connection level-related statistics:
curl -X GET http://127.0.0.1:9089/ima/v1/monitor/Connection?Endpoint=Endpoint%26StatType=StatType
where:
-
- Endpoint
- Specifies the name of the endpoint.
-
- StatType
- Specifies the type of data to order the results by.
Note: Connection data might be up to 60 seconds out of date.
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.
-
The following fields are returned:
-
- Name
- String
-
- Protocol
- String
-
- ClientAddr
- String
-
- UserId
- String
-
- Endpoint
- String
-
- Port
- Numeric
-
- ConnectTime
- Numeric
-
- Duration
- Numeric
-
- ReadBytes
- Numeric
-
- ReadMsg
- Numeric
-
- WriteBytes
- Numeric
-
- WriteMsg
- Numeric
-
Example
The following example uses cURL to show how a GET method is used to create statistics about connections ordered by the highest throughput of messages:
curl -X GET http://127.0.0.1:9089/ima/v1/monitor/Connection?Endpoint=DemoEndpoint%26StatType=HighestThroughputMsgs
The following example shows a successful example response to the GET method that was used to create statistics about endpoints with the highest throughput of messages:
{ "Version":"v1", "Connection": [ { "Name":"DemoClientId","Protocol":"mqtt","ClientAddr":"9.20.230.65","UserId":"",
"Endpoint":"DemoEndpoint","Port":16102,"ConnectTime":1446728129213566618,"Duration":160676522991,"ReadBytes":39,"ReadMsg":0,
"WriteBytes":14,"WriteMsg":0} } ] }