-
Notifications
You must be signed in to change notification settings - Fork 25k
Update metrics.md #30091
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update metrics.md #30091
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,8 +63,7 @@ If the [dotnet-counters](/dotnet/core/diagnostics/dotnet-counters) tool isn't in | |
| dotnet tool update -g dotnet-counters | ||
| ``` | ||
|
|
||
| While the test app is running, launch [dotnet-counters](/dotnet/core/diagnostics/dotnet-counters). | ||
| The following command shows an example of `dotnet-counters` monitoring all metrics from the `Microsoft.AspNetCore.Hosting` meter. | ||
| While the test app is running, launch [dotnet-counters](/dotnet/core/diagnostics/dotnet-counters). The following command shows an example of `dotnet-counters` monitoring all metrics from the `Microsoft.AspNetCore.Hosting` meter. | ||
|
|
||
| ```dotnetcli | ||
| dotnet-counters monitor -n WebMetric --counters Microsoft.AspNetCore.Hosting | ||
|
|
@@ -88,15 +87,7 @@ Press p to pause, r to resume, q to quit. | |
| host=localhost,method=GET,port=5045,protocol=HTTP/1.1,ro 0 12 | ||
| ``` | ||
|
|
||
| Run `WebMetric>dotnet-counters list` to show all available metrics. | ||
|
|
||
| The following command shows the `Microsoft-AspNetCore-Server-Kestrel` meter with the `requests-per-second` and `total-requests` counters. | ||
|
|
||
| ```dotnetcli | ||
| dotnet-counters monitor -n WebMetric --counters Microsoft.AspNetCore.Hosting[requests-per-second,total-requests] | ||
| ``` | ||
|
Comment on lines
-93
to
-97
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This kind of detail can be left out. People who want to know can look at the dotnet-counters detail page. |
||
|
|
||
| For more information, see [dotnet-counters](/dotnet/core/diagnostics/dotnet-counters). To learn more about metrics in .NET, see [built-in metrics](/dotnet/core/diagnostics/available-counters). | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I remove the link to the available counters page as it just shows event counters for now. |
||
| For more information, see [dotnet-counters](/dotnet/core/diagnostics/dotnet-counters). | ||
|
|
||
| ## Create custom metrics | ||
|
|
||
|
|
@@ -200,7 +191,7 @@ public class BasicTests : IClassFixture<WebApplicationFactory<Program>> | |
| // Assert | ||
| Assert.Equal("Hello World!", await response.Content.ReadAsStringAsync()); | ||
|
|
||
| await collector.WaitForMeasurementsAsync(minCount: 1); | ||
| await collector.WaitForMeasurementsAsync(minCount: 1).WaitAsync(TimeSpan.FromSeconds(5)); | ||
| Assert.Collection(collector.GetMeasurementSnapshot(), | ||
| measurement => | ||
| { | ||
|
|
@@ -219,7 +210,7 @@ The proceeding test: | |
| * Requires a package reference to `Microsoft.Extensions.Telemetry.Testing`. | ||
| * The `MetricCollector` is created using the web app's `IMeterFactory`. This allows the collector to only report metrics values recorded by test. | ||
| * Includes the meter name, `Microsoft.AspNetCore.Hosting`, and counter name, `http.server.request.duration` to collect. | ||
| * Makes a HTTP request to the app web. | ||
| * Makes an HTTP request to the web app. | ||
| * Asserts the test using results from the metrics collector. | ||
|
|
||
| ## ASP.NET Core meters and counters | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dotnet-counters listisn't very useful right now. Removed.