mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-12 18:07:22 +01:00
add metrics to CachedFileProvider
This commit is contained in:
parent
25aa01c819
commit
61af3a3da5
3 changed files with 16 additions and 20 deletions
|
|
@ -35,11 +35,10 @@ public class FileCleanupService : IHostedService
|
|||
_cleanupCts = new();
|
||||
|
||||
DirectoryInfo dir = new(_cacheDir);
|
||||
var allFiles = dir.GetFiles();
|
||||
var allFiles = dir.GetFiles("*", SearchOption.AllDirectories);
|
||||
_metrics.SetGaugeTo(MetricsAPI.GaugeFilesTotalSize, allFiles.Sum(f => f.Length));
|
||||
_metrics.SetGaugeTo(MetricsAPI.GaugeFilesTotal, allFiles.Length);
|
||||
|
||||
|
||||
_ = CleanUpTask(_cleanupCts.Token);
|
||||
|
||||
return Task.CompletedTask;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue