@@ -36,10 +36,30 @@ public void Format(IBufferWriter<byte> writer, OperationPlan plan, OperationPlan
36
36
jsonWriter . WriteString ( "id" , plan . Id ) ;
37
37
38
38
jsonWriter . WritePropertyName ( "operation" ) ;
39
- WriteOperation ( jsonWriter , plan . Operation , trace ) ;
39
+ WriteOperation ( jsonWriter , plan . Operation ) ;
40
40
41
41
jsonWriter . WriteNumber ( "searchSpace" , plan . SearchSpace ) ;
42
42
43
+ if ( trace is not null )
44
+ {
45
+ if ( ! string . IsNullOrEmpty ( trace . AppId ) )
46
+ {
47
+ jsonWriter . WriteString ( "appId" , trace . AppId ) ;
48
+ }
49
+
50
+ if ( ! string . IsNullOrEmpty ( trace . EnvironmentName ) )
51
+ {
52
+ jsonWriter . WriteString ( "environment" , trace . EnvironmentName ) ;
53
+ }
54
+
55
+ if ( ! string . IsNullOrEmpty ( trace . TraceId ) )
56
+ {
57
+ jsonWriter . WriteString ( "traceId" , trace . TraceId ) ;
58
+ }
59
+
60
+ jsonWriter . WriteNumber ( "duration" , trace . Duration . TotalMilliseconds ) ;
61
+ }
62
+
43
63
jsonWriter . WritePropertyName ( "nodes" ) ;
44
64
WriteNodes ( jsonWriter , plan . AllNodes , trace ) ;
45
65
@@ -52,7 +72,7 @@ internal void Format(IBufferWriter<byte> writer, Operation operation, ImmutableA
52
72
jsonWriter . WriteStartObject ( ) ;
53
73
54
74
jsonWriter . WritePropertyName ( "operation" ) ;
55
- WriteOperation ( jsonWriter , operation , null ) ;
75
+ WriteOperation ( jsonWriter , operation ) ;
56
76
57
77
jsonWriter . WritePropertyName ( "nodes" ) ;
58
78
WriteNodes ( jsonWriter , allNodes , null ) ;
@@ -62,8 +82,7 @@ internal void Format(IBufferWriter<byte> writer, Operation operation, ImmutableA
62
82
63
83
private static void WriteOperation (
64
84
Utf8JsonWriter jsonWriter ,
65
- Operation operation ,
66
- OperationPlanTrace ? trace )
85
+ Operation operation )
67
86
{
68
87
jsonWriter . WriteStartObject ( ) ;
69
88
@@ -79,26 +98,6 @@ private static void WriteOperation(
79
98
jsonWriter . WriteString ( "hash" , operation . Hash ) ;
80
99
jsonWriter . WriteString ( "shortHash" , operation . Hash [ ..8 ] ) ;
81
100
82
- if ( trace is not null )
83
- {
84
- if ( ! string . IsNullOrEmpty ( trace . AppId ) )
85
- {
86
- jsonWriter . WriteString ( "appId" , trace . AppId ) ;
87
- }
88
-
89
- if ( ! string . IsNullOrEmpty ( trace . EnvironmentName ) )
90
- {
91
- jsonWriter . WriteString ( "environment" , trace . EnvironmentName ) ;
92
- }
93
-
94
- if ( ! string . IsNullOrEmpty ( trace . TraceId ) )
95
- {
96
- jsonWriter . WriteString ( "traceId" , trace . TraceId ) ;
97
- }
98
-
99
- jsonWriter . WriteNumber ( "duration" , trace . Duration . TotalMilliseconds ) ;
100
- }
101
-
102
101
jsonWriter . WriteEndObject ( ) ;
103
102
}
104
103
0 commit comments