Skip to content

Commit 6ef4ab3

Browse files
gewarrensirntar
authored andcommitted
More doc updates for source-of-truth assemblies (dotnet#107810)
1 parent f198558 commit 6ef4ab3

File tree

82 files changed

+648
-496
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+648
-496
lines changed

src/libraries/Microsoft.Extensions.Diagnostics.Abstractions/src/Metrics/IMetricsBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
namespace Microsoft.Extensions.Diagnostics.Metrics
77
{
88
/// <summary>
9-
/// Represents a type used to configure the metrics system by registering IMetricsListeners and using rules
9+
/// Configures the metrics system by registering IMetricsListeners and using rules
1010
/// to determine which metrics are enabled.
1111
/// </summary>
1212
public interface IMetricsBuilder
1313
{
1414
/// <summary>
15-
/// The application <see cref="IServiceCollection"/>. This is used by extension methods to register services.
15+
/// Gets the application service collection that's used by extension methods to register services.
1616
/// </summary>
1717
IServiceCollection Services { get; }
1818
}

src/libraries/Microsoft.Extensions.Diagnostics.Abstractions/src/Metrics/IMetricsListener.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
namespace Microsoft.Extensions.Diagnostics.Metrics
77
{
88
/// <summary>
9-
/// Represents a type used to listen to metrics emitted from the system.
9+
/// Listens to metrics emitted from the system.
1010
/// </summary>
1111
public interface IMetricsListener
1212
{
1313
/// <summary>
14-
/// The name of the listener. This is used to identify the listener in the rules configuration.
14+
/// Gets the name of the listener. This is used to identify the listener in the rules configuration.
1515
/// </summary>
1616
public string Name { get; }
1717

@@ -27,7 +27,7 @@ public interface IMetricsListener
2727
/// <param name="instrument">The new <see cref="Instrument"/>.</param>
2828
/// <param name="userState">Listener state associated with this instrument. This will be returned to <see cref="MeasurementCallback{T}"/>
2929
/// and <see cref="MeasurementsCompleted(Instrument, object?)"/>.</param>
30-
/// <returns>Returns true if the listener wants to subscribe to this instrument, otherwise false.</returns>
30+
/// <returns><see langword="true" /> if the listener wants to subscribe to this instrument, otherwise <see langword="false" />.</returns>
3131
public bool InstrumentPublished(Instrument instrument, out object? userState);
3232

3333
/// <summary>

src/libraries/Microsoft.Extensions.Diagnostics.Abstractions/src/Metrics/IObservableInstrumentsSource.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
namespace Microsoft.Extensions.Diagnostics.Metrics
77
{
88
/// <summary>
9-
/// An interface registered with each IMetricsListener using <see cref="IMetricsListener.Initialize(IObservableInstrumentsSource)"/>. The listener
10-
/// can call <see cref="RecordObservableInstruments"/> to receive the current set of measurements for enabled observable instruments.
9+
/// An interface registered with each IMetricsListener using <see cref="IMetricsListener.Initialize(IObservableInstrumentsSource)"/>.
1110
/// </summary>
11+
/// <remarks>
12+
/// The listener can call <see cref="RecordObservableInstruments"/> to receive the current set of measurements for enabled observable instruments.
13+
/// </remarks>
1214
public interface IObservableInstrumentsSource
1315
{
1416
/// <summary>
15-
/// Requests that the current set of metrics for enabled instruments be sent to the listener's <see cref="MeasurementCallback{T}"/>'s.
17+
/// Requests that the current set of metrics for enabled instruments be sent to the listener's <see cref="MeasurementCallback{T}"/> objects.
1618
/// </summary>
1719
public void RecordObservableInstruments();
1820
}

src/libraries/Microsoft.Extensions.Diagnostics.Abstractions/src/Metrics/InstrumentRule.cs

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,41 @@ namespace Microsoft.Extensions.Diagnostics.Metrics
2020
/// <param name="meterName">The <see cref="Meter.Name">Meter.Name</see> or prefix.</param>
2121
/// <param name="instrumentName">The <see cref="Instrument.Name">Instrument.Name</see>.</param>
2222
/// <param name="listenerName">The <see cref="IMetricsListener.Name">IMetricsListener.Name</see>.</param>
23-
/// <param name="scopes">The <see cref="MeterScope"/>'s to consider.</param>
24-
/// <param name="enable">Enables or disabled the matched instrument for this listener.</param>
23+
/// <param name="scopes">A bitwise combination of the enumeration values that specifies the scopes to consider.</param>
24+
/// <param name="enable"><see langword="true" /> to enable the matched instrument for this listener; otherwise, <see langword="false" />.</param>
2525
public class InstrumentRule(string? meterName, string? instrumentName, string? listenerName, MeterScope scopes, bool enable)
2626
{
2727
/// <summary>
2828
/// Gets the <see cref="Meter.Name">Meter.Name</see>, either an exact match or the longest prefix match. Only full segment matches are considered.
29-
/// All meters are matched if this is <see langword="null" />.
3029
/// </summary>
30+
/// <value>
31+
/// The meter name. If <see langword="null" />, all meters are matched.
32+
/// </value>
3133
public string? MeterName { get; } = meterName;
3234

3335
/// <summary>
3436
/// Gets the <see cref="Instrument.Name">Instrument.Name</see>, an exact match.
35-
/// All instruments for the given meter are matched if this is <see langword="null" />.
3637
/// </summary>
38+
/// <value>
39+
/// The instrument name. If <see langword="null" />, all instruments for the meter are matched.
40+
/// </value>
3741
public string? InstrumentName { get; } = instrumentName;
3842

3943
/// <summary>
4044
/// Gets the <see cref="IMetricsListener.Name">IMetricsListener.Name</see>, an exact match.
41-
/// All listeners are matched if this is <see langword="null" />.
4245
/// </summary>
46+
/// <value>
47+
/// The listener name. If <see langword="null" />, all listeners are matched.
48+
/// </value>
4349
public string? ListenerName { get; } = listenerName;
4450

4551
/// <summary>
46-
/// Gets the <see cref="MeterScope"/>. This is used to distinguish between meters created via <see cref="Meter"/> constructors (<see cref="MeterScope.Global"/>)
47-
/// and those created via Dependency Injection with <see cref="IMeterFactory.Create(MeterOptions)"/> (<see cref="MeterScope.Local"/>)."/>.
52+
/// Gets the <see cref="MeterScope"/>.
4853
/// </summary>
54+
/// <remarks>
55+
/// This property is used to distinguish between meters created via <see cref="Meter"/> constructors (<see cref="MeterScope.Global"/>)
56+
/// and those created via Dependency Injection with <see cref="IMeterFactory.Create(MeterOptions)"/> (<see cref="MeterScope.Local"/>).
57+
/// </remarks>
4958
public MeterScope Scopes { get; } = scopes == MeterScope.None
5059
? throw new ArgumentOutOfRangeException(nameof(scopes), scopes, "The MeterScope must be Global, Local, or both.")
5160
: scopes;

src/libraries/Microsoft.Extensions.Diagnostics.Abstractions/src/Metrics/MeasurementHandlers.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,42 +6,42 @@
66
namespace Microsoft.Extensions.Diagnostics.Metrics
77
{
88
/// <summary>
9-
/// A set of supported measurement types. If a listener does not support a given type, the measurement will be skipped.
9+
/// Represents a set of supported measurement types. If a listener does not support a given type, the measurement is skipped.
1010
/// </summary>
1111
public class MeasurementHandlers
1212
{
1313
/// <summary>
14-
/// A <see cref="MeasurementCallback{T}"/> for <see cref="byte"/>. If null, byte measurements will be skipped.
14+
/// Gets or sets a <see cref="MeasurementCallback{T}"/> for <see cref="byte"/>. If <see langword="null"/>, byte measurements are skipped.
1515
/// </summary>
1616
public MeasurementCallback<byte>? ByteHandler { get; set; }
1717

1818
/// <summary>
19-
/// A <see cref="MeasurementCallback{T}"/> for <see cref="short"/>. If null, short measurements will be skipped.
19+
/// Gets or sets a <see cref="MeasurementCallback{T}"/> for <see cref="short"/>. If <see langword="null"/>, short measurements are skipped.
2020
/// </summary>
2121
public MeasurementCallback<short>? ShortHandler { get; set; }
2222

2323
/// <summary>
24-
/// A <see cref="MeasurementCallback{T}"/> for <see cref="int"/>. If null, int measurements will be skipped.
24+
/// Gets or sets a <see cref="MeasurementCallback{T}"/> for <see cref="int"/>. If <see langword="null"/>, int measurements are skipped.
2525
/// </summary>
2626
public MeasurementCallback<int>? IntHandler { get; set; }
2727

2828
/// <summary>
29-
/// A <see cref="MeasurementCallback{T}"/> for <see cref="long"/>. If null, long measurements will be skipped.
29+
/// Gets or sets a <see cref="MeasurementCallback{T}"/> for <see cref="long"/>. If <see langword="null"/>, long measurements are skipped.
3030
/// </summary>
3131
public MeasurementCallback<long>? LongHandler { get; set; }
3232

3333
/// <summary>
34-
/// A <see cref="MeasurementCallback{T}"/> for <see cref="float"/>. If null, float measurements will be skipped.
34+
/// Gets or sets a <see cref="MeasurementCallback{T}"/> for <see cref="float"/>. If <see langword="null"/>, float measurements are skipped.
3535
/// </summary>
3636
public MeasurementCallback<float>? FloatHandler { get; set; }
3737

3838
/// <summary>
39-
/// A <see cref="MeasurementCallback{T}"/> for <see cref="double"/>. If null, double measurements will be skipped.
39+
/// Gets or sets a <see cref="MeasurementCallback{T}"/> for <see cref="double"/>. If <see langword="null"/>, double measurements are skipped.
4040
/// </summary>
4141
public MeasurementCallback<double>? DoubleHandler { get; set; }
4242

4343
/// <summary>
44-
/// A <see cref="MeasurementCallback{T}"/> for <see cref="decimal"/>. If null, decimal measurements will be skipped.
44+
/// Gets or sets a <see cref="MeasurementCallback{T}"/> for <see cref="decimal"/>. If <see langword="null"/>, decimal measurements are skipped.
4545
/// </summary>
4646
public MeasurementCallback<decimal>? DecimalHandler { get; set; }
4747
}

src/libraries/Microsoft.Extensions.Diagnostics.Abstractions/src/Metrics/MeterScope.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
namespace Microsoft.Extensions.Diagnostics.Metrics
88
{
99
/// <summary>
10-
/// This is used by <see cref="InstrumentRule"/> to distinguish between meters created via <see cref="Meter"/> constructors (<see cref="Global"/>)
11-
/// and those created via Dependency Injection with <see cref="IMeterFactory.Create(MeterOptions)"/> (<see cref="Local"/>)."/>.
10+
/// Represents scopes used by <see cref="InstrumentRule"/> to distinguish between meters created via <see cref="Meter"/> constructors (<see cref="Global"/>)
11+
/// and those created via Dependency Injection with <see cref="IMeterFactory.Create(MeterOptions)"/> (<see cref="Local"/>).
1212
/// </summary>
1313
[Flags]
1414
public enum MeterScope
1515
{
1616
/// <summary>
17-
/// No scope is specified. This should not be used.
17+
/// No scope is specified. This field should not be used.
1818
/// </summary>
1919
None = 0,
2020

src/libraries/Microsoft.Extensions.Diagnostics.Abstractions/src/Metrics/MetricsBuilderExtensions.Rules.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace Microsoft.Extensions.Diagnostics.Metrics
1313
public static partial class MetricsBuilderExtensions
1414
{
1515
/// <summary>
16-
/// Enables all <see cref="Instrument"/>'s for the given meter, for all registered <see cref="IMetricsListener"/>'s.
16+
/// Enables all instruments for the given meter, for all registered listeners.
1717
/// </summary>
1818
/// <param name="builder">The <see cref="IMetricsBuilder"/>.</param>
1919
/// <param name="meterName">The <see cref="Meter.Name"/> or prefix. A null value matches all meters.</param>
@@ -28,14 +28,14 @@ public static IMetricsBuilder EnableMetrics(this IMetricsBuilder builder, string
2828
/// <param name="meterName">The <see cref="Meter.Name"/> or prefix. A null value matches all meters.</param>
2929
/// <param name="instrumentName">The <see cref="Instrument.Name"/>. A null value matches all instruments.</param>
3030
/// <param name="listenerName">The <see cref="IMetricsListener"/>.Name. A null value matches all listeners.</param>
31-
/// <param name="scopes">Indicates which <see cref="MeterScope"/>'s to consider. Default to all scopes.</param>
31+
/// <param name="scopes">Indicates which meter scopes to consider. Defaults to all scopes.</param>
3232
/// <returns>The original <see cref="IMetricsBuilder"/> for chaining.</returns>
3333
public static IMetricsBuilder EnableMetrics(this IMetricsBuilder builder, string? meterName, string? instrumentName = null, string? listenerName = null,
3434
MeterScope scopes = MeterScope.Global | MeterScope.Local)
3535
=> builder.ConfigureRule(options => options.EnableMetrics(meterName, instrumentName, listenerName, scopes));
3636

3737
/// <summary>
38-
/// Enables all <see cref="Instrument"/>'s for the given meter, for all registered <see cref="IMetricsListener"/>'s.
38+
/// Enables all instruments for the given meter, for all registered listeners.
3939
/// </summary>
4040
/// <param name="options">The <see cref="MetricsOptions"/>.</param>
4141
/// <param name="meterName">The <see cref="Meter.Name"/> or prefix. A null value matches all meters.</param>
@@ -50,14 +50,14 @@ public static MetricsOptions EnableMetrics(this MetricsOptions options, string?
5050
/// <param name="meterName">The <see cref="Meter.Name"/> or prefix. A null value matches all meters.</param>
5151
/// <param name="instrumentName">The <see cref="Instrument.Name"/>. A null value matches all instruments.</param>
5252
/// <param name="listenerName">The <see cref="IMetricsListener"/>.Name. A null value matches all listeners.</param>
53-
/// <param name="scopes">Indicates which <see cref="MeterScope"/>'s to consider. Default to all scopes.</param>
53+
/// <param name="scopes">Indicates which meter scopes to consider. Default to all scopes.</param>
5454
/// <returns>The original <see cref="MetricsOptions"/> for chaining.</returns>
5555
public static MetricsOptions EnableMetrics(this MetricsOptions options, string? meterName, string? instrumentName = null, string? listenerName = null,
5656
MeterScope scopes = MeterScope.Global | MeterScope.Local)
5757
=> options.AddRule(meterName, instrumentName, listenerName, scopes, enable: true);
5858

5959
/// <summary>
60-
/// Disables all <see cref="Instrument"/>'s for the given meter, for all registered <see cref="IMetricsListener"/>'s.
60+
/// Disables all instruments for the given meter, for all registered listeners.
6161
/// </summary>
6262
/// <param name="builder">The <see cref="IMetricsBuilder"/>.</param>
6363
/// <param name="meterName">The <see cref="Meter.Name"/> or prefix. A null value matches all meters.</param>
@@ -72,14 +72,14 @@ public static IMetricsBuilder DisableMetrics(this IMetricsBuilder builder, strin
7272
/// <param name="meterName">The <see cref="Meter.Name"/> or prefix. A null value matches all meters.</param>
7373
/// <param name="instrumentName">The <see cref="Instrument.Name"/>. A null value matches all instruments.</param>
7474
/// <param name="listenerName">The <see cref="IMetricsListener"/>.Name. A null value matches all listeners.</param>
75-
/// <param name="scopes">Indicates which <see cref="MeterScope"/>'s to consider. Default to all scopes.</param>
75+
/// <param name="scopes">Indicates which meter scopes to consider. Defaults to all scopes.</param>
7676
/// <returns>The original <see cref="IMetricsBuilder"/> for chaining.</returns>
7777
public static IMetricsBuilder DisableMetrics(this IMetricsBuilder builder, string? meterName, string? instrumentName = null, string? listenerName = null,
7878
MeterScope scopes = MeterScope.Global | MeterScope.Local)
7979
=> builder.ConfigureRule(options => options.DisableMetrics(meterName, instrumentName, listenerName, scopes));
8080

8181
/// <summary>
82-
/// Disables all <see cref="Instrument"/>'s for the given meter, for all registered <see cref="IMetricsListener"/>'s.
82+
/// Disables all instruments for the given meter, for all registered listeners.
8383
/// </summary>
8484
/// <param name="options">The <see cref="MetricsOptions"/>.</param>
8585
/// <param name="meterName">The <see cref="Meter.Name"/> or prefix. A null value matches all meters.</param>
@@ -94,7 +94,7 @@ public static MetricsOptions DisableMetrics(this MetricsOptions options, string?
9494
/// <param name="meterName">The <see cref="Meter.Name"/> or prefix. A null value matches all meters.</param>
9595
/// <param name="instrumentName">The <see cref="Instrument.Name"/>. A null value matches all instruments.</param>
9696
/// <param name="listenerName">The <see cref="IMetricsListener"/>.Name. A null value matches all listeners.</param>
97-
/// <param name="scopes">Indicates which <see cref="MeterScope"/>'s to consider. Default to all scopes.</param>
97+
/// <param name="scopes">Indicates which meter scopes to consider. Defaults to all scopes.</param>
9898
/// <returns>The original <see cref="MetricsOptions"/> for chaining.</returns>
9999
public static MetricsOptions DisableMetrics(this MetricsOptions options, string? meterName, string? instrumentName = null, string? listenerName = null,
100100
MeterScope scopes = MeterScope.Global | MeterScope.Local)

src/libraries/Microsoft.Extensions.Diagnostics.Abstractions/src/Metrics/MetricsOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
namespace Microsoft.Extensions.Diagnostics.Metrics
77
{
88
/// <summary>
9-
/// Options for configuring the metrics system.
9+
/// Represents options for configuring the metrics system.
1010
/// </summary>
1111
public class MetricsOptions
1212
{
1313
/// <summary>
14-
/// A list of <see cref="InstrumentRule"/>'s that identify which metrics, instruments, and listeners are enabled.
14+
/// Gets a list of instrument rules that identifies which metrics, instruments, and listeners are enabled.
1515
/// </summary>
1616
public IList<InstrumentRule> Rules { get; } = new List<InstrumentRule>();
1717
}

src/libraries/Microsoft.Extensions.Diagnostics/src/Metrics/Configuration/MetricsBuilderConfigurationExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public static class MetricsBuilderConfigurationExtensions
1717
{
1818
/// <summary>
1919
/// Reads metrics configuration from the provided <see cref="IConfiguration"/> section and configures
20-
/// which <see cref="Meter"/>'s, <see cref="Instrument"/>'s, and <see cref="IMetricsListener"/>'s are enabled.
20+
/// which <see cref="Meter">Meters</see>, <see cref="Instrument">Instruments</see>, and <see cref="IMetricsListener">IMetricsListeners</see> are enabled.
2121
/// </summary>
2222
/// <param name="builder">The <see cref="IMetricsBuilder"/>.</param>
2323
/// <param name="configuration">The <see cref="IConfiguration"/> section to load.</param>

src/libraries/Microsoft.Extensions.Diagnostics/src/Metrics/ConsoleMetrics.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
namespace Microsoft.Extensions.Diagnostics.Metrics
55
{
66
/// <summary>
7-
/// Constants for the Console metrics listener.
7+
/// Provides constants for the Console metrics listener.
88
/// </summary>
99
public static class ConsoleMetrics
1010
{
1111
/// <summary>
12-
/// The name of the listener used in configuration and enabling instruments.
12+
/// Gets the name of the listener used in configuration and enabling instruments.
1313
/// </summary>
1414
public static string DebugListenerName => "DebugConsole";
1515
}

0 commit comments

Comments
 (0)