Browse Source

hide jellyfin timing stats by default; enable with env var

pull/2756/head
Jason Dove 7 months ago
parent
commit
e692aaf6bd
No known key found for this signature in database
  1. 1
      CHANGELOG.md
  2. 3
      ErsatzTV.Core/SystemEnvironment.cs
  3. 3
      ErsatzTV.Infrastructure/ScanProfiler.cs

1
CHANGELOG.md

@ -40,6 +40,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -40,6 +40,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- `ETV_SLOW_API_MS` - milliseconds threshold for logging slow API calls (at DEBUG level)
- This is currently limited to *Jellyfin*
- `ETV_JF_PAGE_SIZE` - page size for library scan API calls to Jellyfin; default value is 10
- `ETV_JF_ENABLE_STATS` - enables logging timing information related to Jellyfin show library scans
- Add `Select All` button to media pages by @Erotemic
### Fixed

3
ErsatzTV.Core/SystemEnvironment.cs

@ -56,6 +56,8 @@ public class SystemEnvironment @@ -56,6 +56,8 @@ public class SystemEnvironment
}
JellyfinPageSize = jellyfinPageSize;
JellyfinEnableStats = !string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("ETV_JF_ENABLE_STATS"));
}
public static string BaseUrl { get; }
@ -68,4 +70,5 @@ public class SystemEnvironment @@ -68,4 +70,5 @@ public class SystemEnvironment
public static int? SlowDbMs { get; }
public static int? SlowApiMs { get; }
public static int JellyfinPageSize { get; }
public static bool JellyfinEnableStats { get; }
}

3
ErsatzTV.Infrastructure/ScanProfiler.cs

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
using System.Collections.Concurrent;
using System.Diagnostics;
using ErsatzTV.Core;
namespace ErsatzTV.Infrastructure;
@ -16,7 +17,7 @@ public static class ScanProfiler @@ -16,7 +17,7 @@ public static class ScanProfiler
public static void LogStatistics(Action<string> logAction)
{
if (Measurements.IsEmpty)
if (!SystemEnvironment.JellyfinEnableStats || Measurements.IsEmpty)
{
return;
}

Loading…
Cancel
Save