mirror of
https://github.com/ryzij/ServerMonitor.git
synced 2026-07-14 03:46:58 +00:00
Добавил метод для получения нагрузки на процессор
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using MonitorAgent.Core.Abstraction;
|
||||
using MonitorAgent.Application.Services;
|
||||
using MonitorAgent.Application.Settings;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
@@ -12,7 +13,12 @@ builder.Services.AddOpenApi();
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
|
||||
builder.Services.Configure<CpuMonitorSettings>(builder.Configuration.GetSection("CpuMonitorSettings"));
|
||||
|
||||
builder.Services.AddScoped<IMonitorService, MonitorService>();
|
||||
builder.Services.AddSingleton<RawCpuMonitorService>();
|
||||
builder.Services.AddSingleton<CpuMonitorBackgroundService>();
|
||||
builder.Services.AddHostedService(provider => provider.GetRequiredService<CpuMonitorBackgroundService>());
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user