Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diagnostics: Adds Processor count into CosmosDiagnostics #3194

Merged
merged 5 commits into from
May 19, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public ClientConfigurationTraceDatum(CosmosClientContext cosmosClientContext, Da
this.cachedNumberOfActiveClient = CosmosClient.NumberOfActiveClients;
this.cachedUserAgentString = this.UserAgentContainer.UserAgent;
this.cachedSerializedJson = this.GetSerializedDatum();
this.ProcessorCount = Environment.ProcessorCount;
}

public DateTime ClientCreatedDateTimeUtc { get; }
Expand All @@ -44,6 +45,8 @@ public ClientConfigurationTraceDatum(CosmosClientContext cosmosClientContext, Da

public ConsistencyConfig ConsistencyConfig { get; }

public int ProcessorCount { get; }

public ReadOnlyMemory<byte> SerializedJson
{
get
Expand Down Expand Up @@ -105,6 +108,9 @@ private ReadOnlyMemory<byte> GetSerializedDatum()

jsonTextWriter.WriteFieldName("ConsistencyConfig");
jsonTextWriter.WriteStringValue(this.ConsistencyConfig.ToString());
jsonTextWriter.WriteFieldName("ProcessorCount");
imanvt marked this conversation as resolved.
Show resolved Hide resolved
jsonTextWriter.WriteNumber64Value(this.ProcessorCount);

jsonTextWriter.WriteObjectEnd();

return jsonTextWriter.GetResult();
Expand Down