public override void Visit(CosmosDiagnosticScope cosmosDiagnosticScope) { this.jsonWriter.WriteStartObject(); this.jsonWriter.WritePropertyName("Id"); this.jsonWriter.WriteValue(cosmosDiagnosticScope.Id); this.jsonWriter.WritePropertyName("ElapsedTime"); if (cosmosDiagnosticScope.TryGetElapsedTime(out TimeSpan elapsedTime)) { this.jsonWriter.WriteValue(elapsedTime); } else { this.jsonWriter.WriteValue("Timer Never Stopped."); } this.jsonWriter.WriteEndObject(); }
public override void Visit(CosmosDiagnosticScope cosmosDiagnosticScope) { this.jsonWriter.WriteStartObject(); this.jsonWriter.WritePropertyName("Id"); this.jsonWriter.WriteValue(cosmosDiagnosticScope.Id); if (cosmosDiagnosticScope.IsComplete()) { this.jsonWriter.WritePropertyName("ElapsedTimeInMs"); } else { this.jsonWriter.WritePropertyName("RunningElapsedTimeInMs"); } this.jsonWriter.WriteValue(cosmosDiagnosticScope.GetElapsedTime().TotalMilliseconds); this.jsonWriter.WriteEndObject(); }