mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-30 23:13:39 +01:00
adjustments to config and cleanup nuget, remove implicit usings
This commit is contained in:
parent
afcb268ccc
commit
2510cce711
23 changed files with 156 additions and 96 deletions
|
|
@ -1,7 +1,11 @@
|
|||
using MareSynchronosShared.Data;
|
||||
using MareSynchronosShared.Metrics;
|
||||
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Prometheus;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace MareSynchronosServices.Metrics;
|
||||
|
||||
|
|
@ -16,7 +20,6 @@ public class MareMetrics
|
|||
gauges[MetricsAPI.GaugePairs].IncTo(dbContext.ClientPairs.Count());
|
||||
gauges[MetricsAPI.GaugePairsPaused].IncTo(dbContext.ClientPairs.Count(p => p.IsPaused));
|
||||
gauges[MetricsAPI.GaugeFilesTotal].IncTo(dbContext.Files.Count());
|
||||
gauges[MetricsAPI.GaugeFilesTotalSize].IncTo(Directory.EnumerateFiles(configuration["CacheDirectory"]).Sum(f => new FileInfo(f).Length));
|
||||
}
|
||||
|
||||
private readonly Dictionary<string, Counter> counters = new()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue