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.
    This value can be one of the following values:
    NewestConnection
    Newest Connections.
    OldestConnection
    Oldest Connections.
    HighestThroughputMsgs
    Highest throughput of messages.
    LowestThroughputMsgs
    Lowest throughput of messages.
    HighestThroughputKB
    Highest throughput of data in KB/second.
    LowestThroughputKB
    Lowest throughput of data in KB/second.
    The default value is NewestConnection.
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
      The connection name. The ClientId is commonly used.
    • Protocol
      String
      The name of the protocol.
    • ClientAddr
      String
      The client IP address.
    • UserId
      String
      The primary user ID.
    • Endpoint
      String
      The name of the endpoint.
    • Port
      Numeric
      The Eclipse Amlen server port.
    • ConnectTime
      Numeric
      Specifies the number of microseconds since the unix epoch.
      The time that the connection is created.
    • Duration
      Numeric
      The duration of the connection in nanoseconds.
    • ReadBytes
      Numeric
      The number of bytes read since connection time.
    • ReadMsg
      Numeric
      The number of messages read since connection time.
    • WriteBytes
      Numeric
      The number of bytes written since connection time.
    • WriteMsg
      Numeric
      The number of messages that are written since connection time.

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} } ] }