Table of Contents

Diagnostic

Metrics

To monitor SmppClient or SmppServerClient performance you can use Metrics property. It contains many useful values calculated automatically.

The ISmppClientMetrics type of the Metrics property has the following structure:

  • Sent - Gets the metrics for messages sent.
    • InQueue - Number of messages stored in the queue (awaiting to be sent to the network).
    • Total - Total number of messages sent to the network.
    • Requests
      • Total - Total number of requests sent to the network.
      • PerSecond - Transferring speed for the last second. Messages per second.
      • AvgPerSecond - Average speed since last Reset. Messages per second.
      • WaitingForResponse - Gets number of request PDUs that didn't receive a response with the same sequence number.
      • ResponseTime - shows how fast the remote side processes the requests sent from the application.
        • Minimum - Minimum response time for the request sent to remote side.
        • Average - Average response time for the request sent to remote side.
        • Maximum - Maximum response time for the request sent to remote side.
    • Responses
      • Total - Total number of responses sent to the network.
      • PerSecond - Transferring speed for the last second. Messages per second.
      • AvgPerSecond - Average speed since last Reset. Messages per second.
  • Received - Gets the metrics for messages received.
    • InQueue - Number of received requests stored in the queue (received but not processed in the worker threads).
    • Total - Total number of messages received from the network.
    • Requests
      • Total - Total number of requests received.
      • PerSecond - Transferring speed for the last second. Messages per second.
      • AvgPerSecond - Average speed since last Reset. Messages per second.
      • WaitingForResponse - Number of received requests that didn't processed by the application.
      • ResponseTime - shows how fast the application processes the requests from remote side.
        • Minimum - Minimum response time for the request received from remote side.
        • Average - Average response time for the request received from remote side.
        • Maximum - Maximum response time for the request received from remote side.
    • Responses
      • Total - Total number of responses received.
      • PerSecond - Transferring speed for the last second. Messages per second.
      • AvgPerSecond - Average speed since last Reset. Messages per second.

All properties in the metrics objects are constantly changed during message transferring. If you want to fix the metric's value for further analysis, you can use the method Snapshot().

var clientMetrics = _client.Metrics.Snapshot();

This method copies all current values to new metrics object where the values won't change anymore. The same Snapshot method is also available for child properties, for example:

var requestMetrics = clientMetrics.Sent.Requests.Snapshot();

or

var responseMetrics = clientMetrics.Received.Responses.Snapshot();

You can also use Reset() method for the cases when you need to analyze some part of the process and begin to watch values from zero. The Reset() method is also available for each child metric object.

// start sent requests metrics from zero
_client.Metrics.Sent.Requests.Reset();

//send a batch of messages
var responses = await _client.SubmitAsync(batch);

//take snapshot of metrics values
var sentRequests = _client.Metrics.Sent.Requests.Snapshot();

// display metrics values as string
string performance = sentRequests.ToString();

Special events

You can use special events in base class SmppClientBase for tracking PDUs:

  • with the event evPduReceiving you can monitor all incoming PDUs.
  • event evPduSending is invoked before sending the PDU to network.