Budgerigar is a Performance Budgetting tool for .NET. It allows you to set performance targets and take action if those targets are not met.
For more info you can read the blog post.
Getting Budgerigar
Install from Nuget: Install-Pacakge Budgerigar
Using Budgerigar
var budgetter = new PerformanceBudgetter();
var response = await budgetter.RunWithBudgetAsync("some-task-name", 1.0M, async (budget) => {
// do work
var lotsOfData = await budget.StepAsync("get-data", async () => {
return await provider.GetLotsOfDataAsync();
});
await budget.StepAsync("proccess-data", async () => await processor.PorcessDataAsync(lotsOfData));
}, (result) => {
if(result.IsOver) {
logger.Error(result.GetDetailedOutput());
}
});