Class CosmosDiagnosticsRequestInfo

java.lang.Object
com.azure.cosmos.CosmosDiagnosticsRequestInfo

public final class CosmosDiagnosticsRequestInfo extends Object
This class represents diagnostic information for transport requests (calls to a replica in direct mode, calls to the Gateway for example to get metadata like physical addresses of replica for a partition.
  • Method Details

    • getActivityId

      public String getActivityId()
      Gets the Activity used to track this request in the Cosmos DB service.
      Returns:
      the Activity used to track this request in the Cosmos DB service.
    • getPartitionId

      public String getPartitionId()
      Gets the identifier for the physical partition/shard this request was processed in or null when the request was not targeting a replica/partition directly.
      Returns:
      the identifier for the physical partition/shard this request was processed in or null when the request was not targeting a replica/partition directly.
    • getPartitionKeyRangeId

      public String getPartitionKeyRangeId()
      Gets the PartitionKeyRangeId for the physical partition/shard this request was processed in or null when the request was not targeting a replica/partition directly.
      Returns:
      the PartitionKeyRangeId for the physical partition/shard this request was processed in or null when the request was not targeting a replica/partition directly.
    • getRequestType

      public String getRequestType()
      Gets the type of request
      Returns:
      the type of the request
    • getStartTime

      public Instant getStartTime()
      Gets the start time of the request.
      Returns:
      the start time of the request.
    • getDuration

      public Duration getDuration()
      Gets the total duration for processing this request.
      Returns:
      the total duration for processing this request.
    • getBackendLatency

      public Duration getBackendLatency()
      Gets the backend latency if available or null when backend latency isn't available for a request
      Returns:
      the backend latency if available or null when backend latency isn't available for a request
    • getRequestPipelineEvents

      public Collection<CosmosDiagnosticsRequestEvent> getRequestPipelineEvents()
      Gets more granular information about different stages of the request pipeline.
      Returns:
      more granular information about different stages of the request pipeline.