HangfireIO / Hangfire

An easy way to perform background job processing in .NET and .NET Core applications. No Windows Service or separate process required
https://www.hangfire.io
Other
9.43k stars 1.7k forks source link

Option to disable stats:succeeded counter increment #2458

Closed remizyaka closed 4 weeks ago

remizyaka commented 1 month ago

Seems that stats:succeeded counter is incremented even if StatisticsHistoryAttribute filter is disabled

var filterStat = GlobalJobFilters.Filters.Where(x => x.Instance is StatisticsHistoryAttribute).Single().Instance;
GlobalJobFilters.Filters.Remove(filterStat);

After that hourly counters are no longer incremented, but main counter still updated. Is it possible to disable counters completely, as it cause high CPU spikes when we have a lot of parallel workers

remizyaka commented 4 weeks ago

Fixed with such workaround var succeededHandler = GlobalStateHandlers.Handlers.Where(x => x.StateName == "Succeeded").Single(); GlobalStateHandlers.Handlers.Remove(succeededHandler);