Norr.PerformanceMonitor
1.0.1
See the version list below for details.
dotnet add package Norr.PerformanceMonitor --version 1.0.1
NuGet\Install-Package Norr.PerformanceMonitor -Version 1.0.1
<PackageReference Include="Norr.PerformanceMonitor" Version="1.0.1" />
<PackageVersion Include="Norr.PerformanceMonitor" Version="1.0.1" />
<PackageReference Include="Norr.PerformanceMonitor" />
paket add Norr.PerformanceMonitor --version 1.0.1
#r "nuget: Norr.PerformanceMonitor, 1.0.1"
#:package Norr.PerformanceMonitor@1.0.1
#addin nuget:?package=Norr.PerformanceMonitor&version=1.0.1
#tool nuget:?package=Norr.PerformanceMonitor&version=1.0.1
Norr.PerformanceMonitor
Advanced performance monitoring library for .NET with OpenTelemetry, threshold-based alerting, and flamegraph profiling support.
π¦ NuGet Package
π GitHub Repository
π Overview
Norr.PerformanceMonitor
is a lightweight and extensible monitoring toolkit designed for production-grade .NET applications.
It captures:
- β±οΈ Execution time
- π₯ CPU usage
- π§ Memory allocations
β¦and exports them to console, Prometheus, OTLP, or any alerting destination.
β¨ Key Features
- β‘ Low-overhead performance tracking
- π§΅
using
-based measurement scopes - π― Attribute-based source generation:
Norr.PerformanceMonitor.Attribution
- π§ Sampling & deduplication logic (bloom filter)
- π¨ Slack / webhook alerting on thresholds
- π Flamegraph generation (
.speedscope.json
) - π§© Ready-to-use integrations: ASP.NET Core, MassTransit, MediatR, BackgroundService
π¦ Installation
dotnet add package Norr.PerformanceMonitor
Register the library in your DI container:
services.AddPerformanceMonitoring(o =>
{
o.Sampling.Probability = 0.1;
o.Alerts.DurationMs = 500;
o.Exporters = ExporterFlags.Console | ExporterFlags.Prometheus;
});
ASP.NET Core middleware:
app.UsePerformanceMonitoring();
β‘ Quick Start
π§ͺ Measure any method
[MeasurePerformance]
public void DoWork()
{
Thread.Sleep(200);
}
π‘ Requires installing
Norr.PerformanceMonitor.Attribution
π Monitor background workers
public sealed class MyWorker : BackgroundServiceWrapper
{
public MyWorker(IMonitor m) : base(m) { }
protected override async Task ExecuteCoreAsync(CancellationToken stop)
{
while (!stop.IsCancellationRequested)
await Task.Delay(1000, stop);
}
}
π¬ MediatR + MassTransit integration
services.AddTransient(typeof(IPipelineBehavior<,>), typeof(PerformanceBehavior<,>));
cfg.UseConsumeFilter(typeof(PerformanceFilter<>), provider);
π₯ Flamegraph Export
await using var rec = FlamegraphRecorder.Start("hot.speedscope.json");
DoHotStuff();
Then open the file at speedscope.app
βοΈ Configuration Reference
Option | Description |
---|---|
SamplingOptions.Probability |
Percentage of operations to sample (0.0 - 1.0) |
AlertOptions.DurationMs |
Alert threshold for wall-clock duration (ms) |
AlertOptions.AllocBytes |
Alert threshold for memory allocation (bytes) |
ExporterFlags |
Console, InMemory, Prometheus, OTLP support |
DuplicateGuardOptions |
Bloom filter size and cooldown (anti-spam) |
β€οΈ Credits
Built and maintained by @berkayhuz
Part of the Norr .NET ecosystem
Licensed under MIT
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- MassTransit (>= 8.5.1)
- MediatR (>= 13.0.0)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.0)
- Microsoft.CodeAnalysis.Common (>= 4.14.0)
- Microsoft.CodeAnalysis.CSharp (>= 4.14.0)
- Microsoft.Diagnostics.NETCore.Client (>= 0.2.621003)
- Microsoft.Diagnostics.Tracing.TraceEvent (>= 3.1.23)
- Microsoft.Extensions.DependencyInjection (>= 9.0.7)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.7)
- Microsoft.Extensions.Http (>= 9.0.7)
- Microsoft.Extensions.Options (>= 9.0.7)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Norr.PerformanceMonitor:
Package | Downloads |
---|---|
Norr.PerformanceMonitor.Benchmarks
Modular, production-grade .NET libraries by Norr. Clean Architecture, zero-bloat. |
GitHub repositories
This package is not used by any popular GitHub repositories.