diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2019-05-10 09:19:05 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-10 09:19:05 -0400 |
| commit | 89537abdc453ea8a34f69f8e17c746085130702d (patch) | |
| tree | f0465758df409a81b8eb9ff2373cfc191b1715f7 | |
| parent | abfc41f382c9c1ca0f9aff29207af8b8964991dc (diff) | |
| parent | a9337033c1d95d7238e9411abbc7255ef2456f35 (diff) | |
Merge pull request #1293 from Bond-009/query-time
Fix query time logging
| -rw-r--r-- | Emby.Server.Implementations/Data/SqliteItemRepository.cs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs index 088a6694b..8841a9a50 100644 --- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs @@ -2741,15 +2741,16 @@ namespace Emby.Server.Implementations.Data { var elapsed = (DateTime.UtcNow - startDate).TotalMilliseconds; - int slowThreshold = 100; - #if DEBUG - slowThreshold = 10; + const int SlowThreshold = 100; +#else + const int SlowThreshold = 10; #endif - if (elapsed >= slowThreshold) + if (elapsed >= SlowThreshold) { - Logger.LogWarning("{0} query time (slow): {1:g}. Query: {2}", + Logger.LogWarning( + "{Method} query time (slow): {ElapsedMs}ms. Query: {Query}", methodName, elapsed, commandText); |
