mirror of
https://github.com/Caraxi/mare.server.git
synced 2026-01-02 21:43:39 +01:00
something something metrics
This commit is contained in:
parent
d83e4e060f
commit
4d1ef1f871
7 changed files with 6 additions and 14 deletions
|
|
@ -36,8 +36,9 @@ public class Program
|
|||
|
||||
var metrics = services.GetRequiredService<MareMetrics>();
|
||||
|
||||
metrics.SetGaugeTo(MetricsAPI.GaugePairs, context.ClientPairs.Count());
|
||||
metrics.SetGaugeTo(MetricsAPI.GaugePairsPaused, context.ClientPairs.Count(p => p.IsPaused));
|
||||
metrics.SetGaugeTo(MetricsAPI.GaugeUsersRegistered, context.Users.AsNoTracking().Count());
|
||||
metrics.SetGaugeTo(MetricsAPI.GaugePairs, context.ClientPairs.AsNoTracking().Count());
|
||||
metrics.SetGaugeTo(MetricsAPI.GaugePairsPaused, context.ClientPairs.AsNoTracking().Count(p => p.IsPaused));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ public class SystemInfoService : IHostedService, IDisposable
|
|||
_mareMetrics.SetGaugeTo(MetricsAPI.GaugeGroups, db.Groups.AsNoTracking().Count());
|
||||
_mareMetrics.SetGaugeTo(MetricsAPI.GaugeGroupPairs, db.GroupPairs.AsNoTracking().Count());
|
||||
_mareMetrics.SetGaugeTo(MetricsAPI.GaugeGroupPairsPaused, db.GroupPairs.AsNoTracking().Count(p => p.IsPaused));
|
||||
_mareMetrics.SetGaugeTo(MetricsAPI.GaugeUsersRegistered, db.Users.AsNoTracking().Count());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -185,8 +185,6 @@ public class UserCleanupService : IHostedService
|
|||
dbContext.Users.Remove(user);
|
||||
|
||||
await dbContext.SaveChangesAsync().ConfigureAwait(false);
|
||||
|
||||
metrics.DecGauge(MetricsAPI.GaugeUsersRegistered, 1);
|
||||
}
|
||||
|
||||
public Task StopAsync(CancellationToken cancellationToken)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue