Merge pull request #1293 from Bond-009/query-time

Fix query time logging
This commit is contained in:
Joshua M. Boniface 2019-05-10 09:19:05 -04:00 committed by GitHub
commit 89537abdc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 5 deletions

View File

@ -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);