CosmosDiagnostics Class

  • java.lang.Object
    • com.azure.cosmos.CosmosDiagnostics

public final class CosmosDiagnostics

This class represents response diagnostic statistics associated with a request to Azure Cosmos DB

Method Summary

Modifier and Type Method and Description
Set<String> getContactedRegionNames()

Regions contacted for this request

CosmosDiagnosticsContext getDiagnosticsContext()

Returns the associated CosmosDiagnosticsContext or null if not associated with any context yet.

Duration getDuration()

Retrieves duration related to the completion of the request.

Set<URI> getRegionsContacted()

Regions contacted for this request

String getUserAgent()

Gets the UserAgent header value used by the client issueing this operation

String toString()

Retrieves Response Diagnostic String

Methods inherited from java.lang.Object

Method Details

getContactedRegionNames

public Set getContactedRegionNames()

Regions contacted for this request

Returns:

set of regions contacted for this request

getDiagnosticsContext

public CosmosDiagnosticsContext getDiagnosticsContext()

Returns the associated CosmosDiagnosticsContext or null if not associated with any context yet.

Returns:

the associated CosmosDiagnosticsContext or null if not associated with any context yet.

getDuration

public Duration getDuration()

Retrieves duration related to the completion of the request. This represents end to end duration of an operation including all the retries. This is meant for point operation only, for query please use toString() to get full query diagnostics.

Returns:

request completion duration

getRegionsContacted

@Deprecated
public Set getRegionsContacted()

Regions contacted for this request

Returns:

set of regions contacted for this request

getUserAgent

public String getUserAgent()

Gets the UserAgent header value used by the client issueing this operation

Returns:

the UserAgent header value used for the client that issued this operation

toString

public String toString()

Retrieves Response Diagnostic String

Overrides:

CosmosDiagnostics.toString()

Returns:

Response Diagnostic String

Applies to