|
1 | 1 | --- |
2 | 2 | title: "Visualize dotnet counters" |
3 | 3 | description: Use the .NET Counters tool in the Visual Studio Performance Profiler to visualize dotnet counters over time and better understand your data. |
4 | | -ms.date: "12/7/2020" |
| 4 | +ms.date: "11/05/2024" |
5 | 5 | ms.topic: "conceptual" |
6 | 6 | helpviewer_keywords: |
7 | 7 | - "dotnet, counters, profiling" |
@@ -61,6 +61,30 @@ You can also view graphs in the detailed report by selecting the checkboxes next |
61 | 61 |
|
62 | 62 | The table updates to relevant values for the time selected in the graphs. Use the **Clear Selection** button to reset the selected time range to the entire trace. |
63 | 63 |
|
| 64 | +::: moniker range=">=vs-2022" |
| 65 | +## View .NET Meter counter data |
| 66 | + |
| 67 | +Starting in Visual Studio 2022 version 17.8, .NET Counters tool supports integration with the .NET <xref:System.Diagnostics.Metrics.Meter> API, adding support for instrument options such as `Counter` and `ObservableCounter`. |
| 68 | + |
| 69 | +The `Counter` keeps track of a value changing over time, with the caller reporting updates using `Counter.Add`. In contrast, `ObservableCounter` is similar to `Counter`, but the caller takes care of keeping track of the total value. The .NET Counters tool reports the rate of change in the total. |
| 70 | + |
| 71 | +For more information, see [Creating Metrics](/dotnet/core/diagnostics/metrics-instrumentation). |
| 72 | + |
| 73 | +## View .NET Meter histogram data |
| 74 | + |
| 75 | +Starting in Visual Studio 2022 version 17.12 Preview 2, .NET Counters tool supports .NET <xref:System.Diagnostics.Metrics.Meter> Histogram integration. |
| 76 | + |
| 77 | +The .NET Meter Histogram allows you to identify and analyze histogram data generated by .NET histogram instruments, recorded using `CreateHistogram`. When recording data using the histogram instrument, results are visualized, providing a clear representation of data distribution. |
| 78 | + |
| 79 | +Live histogram data is shown with the rest of the counters, under the name of the Meter instance. |
| 80 | + |
| 81 | +To open the histogram graph, select the instrument name for the Meter instance, as shown here. |
| 82 | + |
| 83 | +:::image type="content" source="../profiling/media/vs-2022/dotnet-counters-meter-histogram.gif" alt-text=".NET Counters meter histogram data."::: |
| 84 | + |
| 85 | +In the preceding example, the tool shows data for the 50th, 90th, and 95th percentiles of the recorded measurements. |
| 86 | +::: moniker-end |
| 87 | + |
64 | 88 | ## Related content |
65 | 89 |
|
66 | 90 | - [Optimizing Profiler settings](../profiling/optimize-profiler-settings.md) |
|
0 commit comments