aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Data/SqliteItemRepository.cs
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2019-05-10 09:19:05 -0400
committerGitHub <noreply@github.com>2019-05-10 09:19:05 -0400
commit89537abdc453ea8a34f69f8e17c746085130702d (patch)
treef0465758df409a81b8eb9ff2373cfc191b1715f7 /Emby.Server.Implementations/Data/SqliteItemRepository.cs
parentabfc41f382c9c1ca0f9aff29207af8b8964991dc (diff)
parenta9337033c1d95d7238e9411abbc7255ef2456f35 (diff)
Merge pull request #1293 from Bond-009/query-time
Fix query time logging
Diffstat (limited to 'Emby.Server.Implementations/Data/SqliteItemRepository.cs')
-rw-r--r--Emby.Server.Implementations/Data/SqliteItemRepository.cs11
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);