Viewing connection level statistics by REST Monitoring APIs

System administrators can view connection level monitoring statistics by using REST Monitoring APIs.

System administrators can view connection level statistics by using a REST Monitoring API, or by using the Amlen WebUI. For more information about using the Amlen WebUI to view connection level statistics, see Viewing connection level statistics by using the GUI.

Connection level monitoring statistics can be created by using a REST Monitoring API. Connection monitoring data is periodically collected and cached. The cache for connection monitoring data is updated every 60 seconds. Therefore, the statistics that are produced can be up to 60 seconds out of date and might not be available immediately if the command is issued at Eclipse Amlen server start time. To create connection level monitoring statistics, complete the following steps:
  1. Use the Eclipse Amlen REST API GET method with the following Eclipse Amlen configuration URI:

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

  2. 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.
The following fields are returned:
  • Name
    String
    The connection name. The CientId 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.

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