mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-05-04 04:56:30 +03:00
Add profiler base (#235)
This PR adds the base classes required for profiling code inside of Octobot. The implementation of the profiler is similar to Minecraft, however it is more detailed and provides per-event logs for each event. This PR does not change any code to be profiled and this is intentional. Changes required for profiling will come as separate PRs, one for commands, one for responders, and one for background services. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
d4871bb23d
commit
7d9a85d815
4 changed files with 153 additions and 0 deletions
|
@ -4,6 +4,7 @@ using Microsoft.Extensions.Hosting;
|
|||
using Microsoft.Extensions.Logging;
|
||||
using Octobot.Commands.Events;
|
||||
using Octobot.Services;
|
||||
using Octobot.Services.Profiler;
|
||||
using Octobot.Services.Update;
|
||||
using Remora.Discord.API.Abstractions.Gateway.Commands;
|
||||
using Remora.Discord.API.Abstractions.Objects;
|
||||
|
@ -86,6 +87,8 @@ public sealed class Octobot
|
|||
.AddPreparationErrorEvent<LoggingPreparationErrorEvent>()
|
||||
.AddPostExecutionEvent<ErrorLoggingPostExecutionEvent>()
|
||||
// Services
|
||||
.AddTransient<Profiler>()
|
||||
.AddSingleton<ProfilerFactory>()
|
||||
.AddSingleton<Utility>()
|
||||
.AddSingleton<GuildDataService>()
|
||||
.AddHostedService<GuildDataService>(provider => provider.GetRequiredService<GuildDataService>())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue