Professional Development – 2023 – Week 52

Image Credit: https://www.flickr.com/photos/54585499@N04/

.NET

Measuring Your Application’s Performance in .NET (via Nick Chapsas)

.NET Aspire gives you premade dashboards to look at logs, traces, the API itself, and metrics. You get several standard things from the metrics such as number of requests, time per request, etc. You can also add your own metrics that will appear on the dashboard. (See IMeterFactory to get things like counters, histograms, gauge, up/down counter.) Note that behind the scenes Aspire is using Open Telemetry to handle graphing.

This is Best Way To Create CLI Apps in .NET (via Nick Chapsas)

  • There’s a NuGet package called Cocona that makes this easier (defining/parsing options, using environment variables, logging, dependency injection) that feels like a .NET app.
  • You can also use CoconaApp.CreateBuilder() which allows you to configure things just like you would for a ASP.NET Core web app. (You’ll need some other NuGet libraries to get an HTTP client.)
  • The video goes over how you can organize commands in your project and several options for exposing commands.