Azure / azure-cosmosdb-java

Java Async SDK for SQL API of Azure Cosmos DB
MIT License
54 stars 61 forks source link

[FEATURE] Direct TCP | Add metrics for tracking the distribution of request and response message sizes #314

Closed David-Noble-at-work closed 4 years ago

David-Noble-at-work commented 4 years ago

This PR ports these features from v4 (https://github.com/Azure/azure-sdk-for-java/pull/7639).

  1. Direct TCP request and response message metrics.
  2. The RequestTimelime class.

Porting the RequestTimeline class reduced the work on this PR and keeps the Direct TCP stack more consistent on the v2.6, v3, and v4 branches. It is a useful addition for debugging the Direct TCP stack though it is not exposed to customers with this PR.

Direct TCP request and response message metrics

These metrics are now provided:

The distributions are tracked for each service endpoint. Message sizes include all parts of an RNTBD message, including the message frame, headers, and content.

Example:

This distribution summarizes the size of request messages sent by RntbdTransportClient.0002 to the service endpoint at socket address cdb-ms-prod-eastus1-fd5.documents.azure.com:14463

azure.cosmos.directTcp.requestSize.RntbdServiceEndpoint.cdb-ms-prod-eastus1-fd5%2Edocuments%2Eazure%2Ecom%3A14463.RntbdTransportClient.0002
             count = 386
               min = 534
               max = 756
              mean = 639.14
            stddev = 72.49
            median = 635.00
              75% <= 741.00
              95% <= 750.00
              98% <= 752.00
              99% <= 754.00
            99.9% <= 756.00

This distribution summarizes the size of the corresponding response messages received by RntbdTransportClient.0002 from the service endpoint at socket address cdb-ms-prod-eastus1-fd5.documents.azure.com:14463

azure.cosmos.directTcp.responseSize.RntbdServiceEndpoint.cdb-ms-prod-eastus1-fd5%2Edocuments%2Eazure%2Ecom%3A14463.RntbdTransportClient.0002
             count = 386
               min = 243
               max = 64705
              mean = 18784.56
            stddev = 26314.27
            median = 1063.00
              75% <= 56298.00
              95% <= 64705.00
              98% <= 64705.00
              99% <= 64705.00
            99.9% <= 64705.00