Show / Hide Table of Contents

Class CosmosQueryDiagnostics

Structured payload describing a single Cosmos DB query execution event. Delivered to CosmosRepository<T>.OnQueryDiagnostics for point operations, per-page feed responses, and query totals.

Inheritance
object
CosmosQueryDiagnostics
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Benday.CosmosDb.Diagnostics
Assembly: Benday.CosmosDb.dll
Syntax
public sealed class CosmosQueryDiagnostics

Properties

| Edit this page View Source

Duration

Wall-clock duration of the SDK round trip. For QueryTotal this is the aggregated duration across all pages.

Declaration
public TimeSpan Duration { get; init; }
Property Value
Type Description
TimeSpan
| Edit this page View Source

EventKind

Which kind of event this is. Drives how sinks route and aggregate.

Declaration
public CosmosQueryEventKind EventKind { get; init; }
Property Value
Type Description
CosmosQueryEventKind
| Edit this page View Source

IsCrossPartition

True if this event (or any page of a multi-page query) was detected as a cross-partition execution. For QueryTotal events this is the OR across all pages.

Declaration
public bool IsCrossPartition { get; init; }
Property Value
Type Description
bool
| Edit this page View Source

Parameters

Query parameters. Null for PointOperation. Populated for LINQ and raw-SQL queries from the underlying QueryDefinition.

Declaration
public IReadOnlyDictionary<string, object?>? Parameters { get; init; }
Property Value
Type Description
IReadOnlyDictionary<string, object>
| Edit this page View Source

PartitionKey

Partition key scope for the operation. Uses a default PartitionKey value (no partition) for cross-partition queries.

Declaration
public PartitionKey PartitionKey { get; init; }
Property Value
Type Description
PartitionKey
| Edit this page View Source

QueryDescription

Logging description for the operation, typically the repository name plus the caller method name, e.g. "CocktailRecipeRepository - SearchByTitleAsync".

Declaration
public string QueryDescription { get; init; }
Property Value
Type Description
string
| Edit this page View Source

QueryText

The generated SQL text. Null for PointOperation events (point operations don't have a query text — just an id and a partition key). Populated for FeedResponsePage and QueryTotal events.

Declaration
public string? QueryText { get; init; }
Property Value
Type Description
string
| Edit this page View Source

RepositoryName

Name of the repository type (e.g. "CocktailRecipeRepository").

Declaration
public string RepositoryName { get; init; }
Property Value
Type Description
string
| Edit this page View Source

RequestCharge

RU consumed. For QueryTotal, this is the accumulated charge across all pages. For FeedResponsePage, just that page. For PointOperation, the single-operation charge.

Declaration
public double RequestCharge { get; init; }
Property Value
Type Description
double
| Edit this page View Source

ResultCount

Number of documents or rows returned. For scalar operations this reflects the scalar result (1 for a successful value, 0 for a null FirstOrDefault, etc.). For FeedResponsePage, the count for that page. For QueryTotal on a feed, the total across pages.

Declaration
public int ResultCount { get; init; }
Property Value
Type Description
int
| Edit this page View Source

Timestamp

When the event was captured, in UTC.

Declaration
public DateTimeOffset Timestamp { get; init; }
Property Value
Type Description
DateTimeOffset
  • Edit this page
  • View Source
In this article
Back to top Copyright © www.benday.com | info@benday.com