NET runtime: dotnet-counters monitor -n metric-instr Output similar to the following is displayed: Press p to pause, r to resume, q to quit.ĭotnet-counters can be run with a different set of metrics to see some of the built-in instrumentation from the. dotnet-counters monitor -n metric-instr HatCo.HatStore Our sample app was metric-instr.exe, substitute this with the name of your sample app. The following command shows an example of dotnet-counters monitoring all metrics from the HatCo.HatStore meter. While the example app is running, launch dotnet-counters. If the dotnet-counters tool isn't installed, run the following command: dotnet tool update -g dotnet-counters It works with both based APIs and EventCounters. It doesn't require setup, making it useful for ad-hoc investigations or verifying that metric instrumentation is working. View metrics with dotnet-countersĭotnet-counters is a command-line tool that can view live metrics for. The preceding code simulates selling hats at random intervals and random times. Static Counter s_hatsSold = s_meter.CreateCounter("hats-sold") Ĭonsole.WriteLine("Press any key to exit") Static Meter s_meter = new("HatCo.HatStore", "1.0.0") Replace the contents of Program.cs with the following code: using dotnet new console -o metric-instrĭotnet add package For more information about creating new metrics using the API, see the instrumentation tutorial. NET runtime also has various metrics built-in. This tutorial creates an app that has basic metric instrumentation. Prerequisitesīefore metrics can be collected, measurements must be produced. NET MeterListener API.įor more information on custom metric instrumentation and options, see Compare metric APIs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |