You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Port System.Diagnostics source code comments to Docs (#2336)
* Port System.Diagnostics source code comments to Docs
* Update Activity.xml
Updated a multiline comment based on Will's suggestion.
* Apply suggestions from code review
Suggested changes by wtgodbe.
* Update Activity.xml
Removed newline.
* Update DiagnosticListener.xml
Removed new lines.
* Update DiagnosticSource.xml
Newlines and link to Write API.
* Apply suggestions from code review
Suggestions by rpetrusha and mairaw
Co-Authored-By: carlossanlop <[email protected]>
* Update xml/System.Diagnostics/Activity.xml
Co-Authored-By: carlossanlop <[email protected]>
* Update xml/System.Diagnostics/Activity.xml
Co-Authored-By: carlossanlop <[email protected]>
* Update xml/System.Diagnostics/Activity.xml
Removing missed summary line
* Update Activity.xml
Removing an unexpected "list" tag that was missed in a previous suggestion
* Update Activity.xml
Removing unexpected item element.
* Apply suggestions from code review
Suggestion I missed by rpetrusha
Co-Authored-By: carlossanlop <[email protected]>
* Apply suggestions from code review
rpetrusha suggestions
Co-Authored-By: Ron Petrusha <[email protected]>
* Addressed mairaw and rpetrusha more complex suggestions.
* Fixed broken xrefs.
* Apply suggestions from code review
Suggestions by rpetrusha.
Co-Authored-By: Ron Petrusha <[email protected]>
* Fixed bad xrefs.
* Fixed bad xref
* minor formatting fixes
* more fixes
* few more fixes
<paramname="operationName">The name of the operation.</param>
44
+
<summary>Initializes a new instance of the <seecref="T:System.Diagnostics.Activity" /> class.</summary>
45
+
<remarks>
46
+
<formattype="text/markdown"><![CDATA[
47
+
48
+
## Remarks
49
+
50
+
Note that <xref:System.Diagnostics.Activity> has a "builder" pattern: you call the constructor, a number of `Set*` and `Add*` APIs, and then call <xref:System.Diagnostics.Activity.Start> to build the activity. You **must** call <xref:System.Diagnostics.Activity.Start> before using the new instance.
51
+
52
+
]]></format>
53
+
</remarks>
46
54
</Docs>
47
55
</Member>
48
56
<MemberMemberName="ActivityTraceFlags">
@@ -89,11 +97,21 @@
89
97
<ParameterName="value"Type="System.String" />
90
98
</Parameters>
91
99
<Docs>
92
-
<paramname="key">To be added.</param>
93
-
<paramname="value">To be added.</param>
94
-
<summary>To be added.</summary>
95
-
<returns>To be added.</returns>
96
-
<remarks>To be added.</remarks>
100
+
<paramname="key">The baggage key.</param>
101
+
<paramname="value">The baggage value.</param>
102
+
<summary>Updates the <seecref="T:System.Diagnostics.Activity" /> to have a new baggage item with the specified key and value.</summary>
103
+
<returns><seelangword="this" /> for convenient chaining.</returns>
104
+
<remarks>
105
+
<formattype="text/markdown"><![CDATA[
106
+
107
+
## Remarks
108
+
109
+
This key/value pair is included in the collection returned by the <see cref="P:System.Diagnostics.Activity.Baggage" /> property, and can also be retrieved by the <xref:System.Diagnostics.Activity.GetBaggageItem%2A> method.
110
+
111
+
`Baggage` is meant for information that is needed for runtime control. For information that is useful to show up in the log with the <xref:System.Diagnostics.Activity>, use the <xref:System.Diagnostics.Activity.Tags> property.
112
+
113
+
]]></format>
114
+
</remarks>
97
115
</Docs>
98
116
</Member>
99
117
<MemberMemberName="AddTag">
@@ -119,11 +137,21 @@
119
137
<ParameterName="value"Type="System.String" />
120
138
</Parameters>
121
139
<Docs>
122
-
<paramname="key">To be added.</param>
123
-
<paramname="value">To be added.</param>
124
-
<summary>To be added.</summary>
125
-
<returns>To be added.</returns>
126
-
<remarks>To be added.</remarks>
140
+
<paramname="key">The tag key.</param>
141
+
<paramname="value">The tag value.</param>
142
+
<summary>Updates the <seecref="T:System.Diagnostics.Activity" /> to have a new tag with the provided <paramrefname="key" /> and <paramrefname="value" />. .</summary>
143
+
<returns><seelangword="this" /> for convenient chaining.</returns>
144
+
<remarks>
145
+
<formattype="text/markdown"><.
334
+
335
+
]]></format>
336
+
</remarks>
293
337
</Docs>
294
338
</Member>
295
339
<MemberMemberName="IdFormat">
@@ -332,9 +376,17 @@
332
376
<ReturnType>System.String</ReturnType>
333
377
</ReturnValue>
334
378
<Docs>
335
-
<summary>To be added.</summary>
336
-
<value>To be added.</value>
337
-
<remarks>To be added.</remarks>
379
+
<summary>Gets the operation name.</summary>
380
+
<value>The name of the operation.</value>
381
+
<remarks>
382
+
<formattype="text/markdown">< for more details.
445
+
446
+
]]></format>
447
+
</remarks>
386
448
</Docs>
387
449
</Member>
388
450
<MemberMemberName="ParentSpanId">
@@ -446,9 +508,17 @@
446
508
<ReturnType>System.String</ReturnType>
447
509
</ReturnValue>
448
510
<Docs>
449
-
<summary>To be added.</summary>
450
-
<value>To be added.</value>
451
-
<remarks>To be added.</remarks>
511
+
<summary>Gets the root ID of this <seecref="T:System.Diagnostics.Activity" />.</summary>
512
+
<value>The root ID, or <seelangword="null" /> if the current instance has either a <seecref="P:System.Diagnostics.Activity.ParentId" /> or an <seecref="P:System.Diagnostics.Activity.Id" />.</value>
513
+
<remarks>
514
+
<formattype="text/markdown"><.
<paramname="endTimeUtc">The UTC stop time.</param>
547
+
<summary>Updates the <seecref="T:System.Diagnostics.Activity" /> to set its <seecref="P:System.Diagnostics.Activity.Duration" /> as the difference between <seecref="P:System.Diagnostics.Activity.StartTimeUtc" /> and the specified stop time.</summary>
548
+
<returns><seelangword="this" /> for convenient chaining.</returns>
479
549
<remarks>To be added.</remarks>
480
550
</Docs>
481
551
</Member>
@@ -501,10 +571,18 @@
501
571
<ParameterName="parentId"Type="System.String" />
502
572
</Parameters>
503
573
<Docs>
504
-
<paramname="parentId">To be added.</param>
505
-
<summary>To be added.</summary>
506
-
<returns>To be added.</returns>
507
-
<remarks>To be added.</remarks>
574
+
<paramname="parentId">The ID of the parent operation.</param>
575
+
<summary>Updates this <seecref="T:System.Diagnostics.Activity" /> to indicate that the <seecref="T:System.Diagnostics.Activity" /> with an ID of <paramrefname="parentId" /> caused this <seecref="T:System.Diagnostics.Activity" />.</summary>
576
+
<returns><seelangword="this" /> for convenient chaining.</returns>
577
+
<remarks>
578
+
<formattype="text/markdown"><![CDATA[
579
+
580
+
## Remarks
581
+
582
+
This property should only be used in 'boundary' scenarios where an <see cref="T:System.Diagnostics.Activity" /> from another process logically started this <see cref="T:System.Diagnostics.Activity" />. The `parentId` brings up the <xref:System.Diagnostics.Activity.Tags> (as well as the <xref:System.Diagnostics.Activity.ParentId> property) and can be used to reconstruct the causal tree.
<paramname="startTimeUtc">The <seecref="T:System.Diagnostics.Activity" /> start time in UTC.</param>
638
+
<summary>Sets the start time of this <seecref="T:System.Diagnostics.Activity" />.</summary>
639
+
<returns><seelangword="this" /> for convenient chaining.</returns>
562
640
<remarks>To be added.</remarks>
563
641
</Docs>
564
642
</Member>
@@ -603,9 +681,23 @@
603
681
</ReturnValue>
604
682
<Parameters />
605
683
<Docs>
606
-
<summary>To be added.</summary>
607
-
<returns>To be added.</returns>
608
-
<remarks>To be added.</remarks>
684
+
<summary>Starts the activity.</summary>
685
+
<returns><seelangword="this" /> for convenient chaining.</returns>
686
+
<remarks>
687
+
<formattype="text/markdown"><![CDATA[
688
+
689
+
## Remarks
690
+
691
+
Calling the `Start` method does the following:
692
+
- Sets <xref:System.Diagnostics.Activity.Parent> to hold <xref:System.Diagnostics.Activity.Current>.
693
+
- Sets <xref:System.Diagnostics.Activity.Current> to this <xref:System.Diagnostics.Activity>.
694
+
- If <xref:System.Diagnostics.Activity.StartTimeUtc> was not set previously, sets it to <xref:System.DateTime.UtcNow?displayProperty=nameWithType>.
695
+
- Generates a unique <xref:System.Diagnostics.Activity.Id> for this activity.</item>
696
+
697
+
Use <xref:System.Diagnostics.DiagnosticSource.StartActivity%2A?displayProperty=nameWithType> to start the <see cref="T:System.Diagnostics.Activity" /> and write the start event.
698
+
699
+
]]></format>
700
+
</remarks>
609
701
</Docs>
610
702
</Member>
611
703
<MemberMemberName="StartTimeUtc">
@@ -627,9 +719,17 @@
627
719
<ReturnType>System.DateTime</ReturnType>
628
720
</ReturnValue>
629
721
<Docs>
630
-
<summary>To be added.</summary>
631
-
<value>To be added.</value>
632
-
<remarks>To be added.</remarks>
722
+
<summary>Gets the time when the operation started.</summary>
723
+
<value>The UTC time that the operation started.</value>
724
+
<remarks>
725
+
<formattype="text/markdown"><![CDATA[
726
+
727
+
## Remarks
728
+
729
+
The `StartTimeUtc` property is typically initialized when <xref:System.Diagnostics.Activity.Start> is called, but it can be set at any time by calling <xref:System.Diagnostics.Activity.SetStartTime%2A>.
730
+
731
+
]]></format>
732
+
</remarks>
633
733
</Docs>
634
734
</Member>
635
735
<MemberMemberName="Stop">
@@ -652,8 +752,22 @@
652
752
</ReturnValue>
653
753
<Parameters />
654
754
<Docs>
655
-
<summary>To be added.</summary>
656
-
<remarks>To be added.</remarks>
755
+
<summary>Stops the activity.</summary>
756
+
<remarks>
757
+
<formattype="text/markdown"><![CDATA[
758
+
759
+
## Remarks
760
+
761
+
This information is NOT passed on to the children of this <xref:System.Diagnostics.Activity>.
762
+
Calling the `Stop` method:
763
+
764
+
- Sets <xref:System.Diagnostics.Activity.Current> to <xref:System.Diagnostics.Activity.Parent>.
765
+
- If the end time was not set previously, sets <xref:System.Diagnostics.Activity.Duration> as the difference between <xref:System.DateTime.UtcNow?displayProperty=nameWithType> and <xref:System.Diagnostics.Activity.StartTimeUtc>.
766
+
767
+
Call <xref:System.Diagnostics.DiagnosticSource.StopActivity%2A?displayProperty=nameWithType> to stop the <xref:System.Diagnostics.Activity> and write the stop event.
<summary>Gets a collection of key/value pairs that represent information that will be logged along with the <seecref="T:System.Diagnostics.Activity" /> to the logging system.</summary>
793
+
<value>An enumeration of string-string key-value-pairs.</value>
0 commit comments