mirror of
				https://github.com/jellyfin/jellyfin.git
				synced 2025-11-04 03:27:21 -05:00 
			
		
		
		
	Fix query time logging
This commit is contained in:
		
							parent
							
								
									a0e61ee67f
								
							
						
					
					
						commit
						a9337033c1
					
				@ -2741,15 +2741,16 @@ namespace Emby.Server.Implementations.Data
 | 
				
			|||||||
        {
 | 
					        {
 | 
				
			||||||
            var elapsed = (DateTime.UtcNow - startDate).TotalMilliseconds;
 | 
					            var elapsed = (DateTime.UtcNow - startDate).TotalMilliseconds;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            int slowThreshold = 100;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#if DEBUG
 | 
					#if DEBUG
 | 
				
			||||||
            slowThreshold = 10;
 | 
					            const int SlowThreshold = 100;
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					            const int SlowThreshold = 10;
 | 
				
			||||||
#endif
 | 
					#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,
 | 
					                    methodName,
 | 
				
			||||||
                    elapsed,
 | 
					                    elapsed,
 | 
				
			||||||
                    commandText);
 | 
					                    commandText);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user