Skip to content

Commit

Permalink
Diagnostics: Adds startDate in Summary (#3707)
Browse files Browse the repository at this point in the history
* Adding start date

* Updated trace files

* PR comment

* Committing missing tests

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>
  • Loading branch information
NimitS1 and ealsur authored Feb 27, 2023
1 parent b257f8e commit 94c83f5
Show file tree
Hide file tree
Showing 15 changed files with 66 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public static void WriteTrace(

if (isRootTrace)
{
writer.WriteFieldName("start time");
writer.WriteStringValue(trace.StartTime.ToString(TraceWriter.HourTimeFormatString));
writer.WriteFieldName("start datetime");
writer.WriteStringValue(trace.StartTime.ToString(TraceWriter.DateTimeFormatString));
}
writer.WriteFieldName("duration in milliseconds");
writer.WriteNumber64Value(trace.Duration.TotalMilliseconds);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace Microsoft.Azure.Cosmos.Tracing
internal static partial class TraceWriter
{
internal static readonly string HourTimeFormatString = "HH:mm:ss:fff";
internal static readonly string DateTimeFormatString = "yyyy-MM-ddTHH:mm:ss.fffZ";

private static class TraceTextWriter
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "ExecuteAsync",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"data": {
"Client Configuration": "Redacted To Not Change The Baselines From Run To Run"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "CreateItemAsync",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"data": {
"Client Configuration": "Redacted To Not Change The Baselines From Run To Run"
Expand Down Expand Up @@ -218,7 +218,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "CreateItemAsync",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"data": {
"Client Configuration": "Redacted To Not Change The Baselines From Run To Run"
Expand Down Expand Up @@ -376,7 +376,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "CreateItemAsync",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"data": {
"Client Configuration": "Redacted To Not Change The Baselines From Run To Run"
Expand Down Expand Up @@ -534,7 +534,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "CreateItemAsync",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"data": {
"Client Configuration": "Redacted To Not Change The Baselines From Run To Run"
Expand Down Expand Up @@ -692,7 +692,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "CreateItemAsync",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"data": {
"Client Configuration": "Redacted To Not Change The Baselines From Run To Run"
Expand Down Expand Up @@ -850,7 +850,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "CreateItemAsync",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"data": {
"Client Configuration": "Redacted To Not Change The Baselines From Run To Run"
Expand Down Expand Up @@ -1008,7 +1008,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "CreateItemAsync",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"data": {
"Client Configuration": "Redacted To Not Change The Baselines From Run To Run"
Expand Down Expand Up @@ -1166,7 +1166,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "CreateItemAsync",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"data": {
"Client Configuration": "Redacted To Not Change The Baselines From Run To Run"
Expand Down Expand Up @@ -1324,7 +1324,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "CreateItemAsync",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"data": {
"Client Configuration": "Redacted To Not Change The Baselines From Run To Run"
Expand Down Expand Up @@ -1482,7 +1482,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "CreateItemAsync",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"data": {
"Client Configuration": "Redacted To Not Change The Baselines From Run To Run"
Expand Down Expand Up @@ -1796,7 +1796,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "CreateItemAsync",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"data": {
"Client Configuration": "Redacted To Not Change The Baselines From Run To Run"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "Trace Forest",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"children": [
{
Expand Down Expand Up @@ -1124,7 +1124,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "Trace Forest",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"children": [
{
Expand Down Expand Up @@ -1738,7 +1738,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "Trace Forest",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"children": [
{
Expand Down Expand Up @@ -2340,7 +2340,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "Trace Forest",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"children": [
{
Expand Down Expand Up @@ -2888,7 +2888,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "Trace Forest",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"children": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "CreateDatabaseAsync",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"data": {
"Client Configuration": "Redacted To Not Change The Baselines From Run To Run"
Expand Down Expand Up @@ -154,7 +154,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "CreateDatabaseAsync",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"data": {
"Client Configuration": "Redacted To Not Change The Baselines From Run To Run"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "CreateItemAsync",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"data": {
"Client Configuration": "Redacted To Not Change The Baselines From Run To Run"
Expand Down Expand Up @@ -254,7 +254,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "CreateItemAsync",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"data": {
"Client Configuration": "Redacted To Not Change The Baselines From Run To Run"
Expand Down Expand Up @@ -514,7 +514,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "CreateItemAsync",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"data": {
"Client Configuration": "Redacted To Not Change The Baselines From Run To Run"
Expand Down Expand Up @@ -750,7 +750,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "CreateItemAsync",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"data": {
"Client Configuration": "Redacted To Not Change The Baselines From Run To Run"
Expand Down Expand Up @@ -1029,7 +1029,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "CreateItemAsync",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"data": {
"Client Configuration": "Redacted To Not Change The Baselines From Run To Run"
Expand Down Expand Up @@ -1267,7 +1267,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "CreateItemAsync",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"data": {
"Client Configuration": "Redacted To Not Change The Baselines From Run To Run"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "Trace Forest",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"children": [
{
Expand Down Expand Up @@ -753,7 +753,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "Trace Forest",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"children": [
{
Expand Down Expand Up @@ -1356,7 +1356,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "Trace Forest",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"children": [
{
Expand Down Expand Up @@ -1947,7 +1947,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "Trace Forest",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"children": [
{
Expand Down Expand Up @@ -2577,7 +2577,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "Trace Forest",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"children": [
{
Expand Down Expand Up @@ -3227,7 +3227,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "Trace Forest",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"children": [
{
Expand Down Expand Up @@ -3827,7 +3827,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "Trace Forest",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"children": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "Trace Forest",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"children": [
{
Expand Down Expand Up @@ -691,7 +691,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "Trace Forest",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"children": [
{
Expand Down Expand Up @@ -1256,7 +1256,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "Trace Forest",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"children": [
{
Expand Down Expand Up @@ -1809,7 +1809,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "Trace Forest",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"children": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "ReadManyItemsStreamAsync",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"data": {
"Client Configuration": "Redacted To Not Change The Baselines From Run To Run"
Expand Down Expand Up @@ -696,7 +696,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "ReadManyItemsAsync",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"data": {
"Client Configuration": "Redacted To Not Change The Baselines From Run To Run"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "CreateItemStreamAsync",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"data": {
"Client Configuration": "Redacted To Not Change The Baselines From Run To Run"
Expand Down Expand Up @@ -130,7 +130,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "ReadItemStreamAsync",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"data": {
"Client Configuration": "Redacted To Not Change The Baselines From Run To Run"
Expand Down Expand Up @@ -227,7 +227,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "ReplaceItemStreamAsync",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"data": {
"Client Configuration": "Redacted To Not Change The Baselines From Run To Run"
Expand Down Expand Up @@ -319,7 +319,7 @@
<Json><![CDATA[{
"Summary": {},
"name": "DeleteItemStreamAsync",
"start time": "00:00:00:000",
"start datetime": "0001-01-01T00:00:00Z",
"duration in milliseconds": 0,
"data": {
"Client Configuration": "Redacted To Not Change The Baselines From Run To Run"
Expand Down
Loading

0 comments on commit 94c83f5

Please sign in to comment.