Add X-Response-Time-ms header and log slow server response time

This commit is contained in:
David
2020-07-14 13:26:47 +02:00
parent f7c7b1e7e1
commit 262e19b691
3 changed files with 93 additions and 0 deletions

View File

@@ -252,6 +252,16 @@ namespace MediaBrowser.Model.Configuration
public string[] UninstalledPlugins { get; set; }
/// <summary>
/// Gets or sets a value indicating whether slow server responses should be logged as a warning.
/// </summary>
public bool EnableSlowResponseWarning { get; set; }
/// <summary>
/// Gets or sets the threshold for the slow response time warning in ms.
/// </summary>
public long SlowResponseThresholdMs { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="ServerConfiguration" /> class.
/// </summary>
@@ -351,6 +361,9 @@ namespace MediaBrowser.Model.Configuration
DisabledImageFetchers = new[] { "The Open Movie Database", "TheMovieDb" }
}
};
EnableSlowResponseWarning = true;
SlowResponseThresholdMs = 500;
}
}