Log total time and total number of directories processed

--HG--
branch : dev
This commit is contained in:
Renaud Paquay
2010-12-03 12:12:04 -08:00
parent 40924a0f73
commit 65c0def67e

View File

@@ -45,6 +45,8 @@ namespace Orchard.Environment {
}
private void CompileViews(object sender, ElapsedEventArgs elapsedEventArgs) {
Stopwatch totalTime = new Stopwatch();
totalTime.Start();
Logger.Information("Starting background compilation of views");
((Timer)sender).Stop();
@@ -91,6 +93,7 @@ namespace Orchard.Environment {
.DirectoriesToBrowse
.SelectMany(folder => GetViewDirectories(folder, context.FileExtensionsToCompile));
int directoryCount = 0;
foreach (var viewDirectory in directories) {
if (_stopping) {
if (Logger.IsEnabled(LogLevel.Information)) {
@@ -104,8 +107,11 @@ namespace Orchard.Environment {
}
CompileDirectory(context, viewDirectory);
directoryCount++;
}
Logger.Information("Ending background compilation of views");
totalTime.Stop();
Logger.Information("Ending background compilation of views, {0} directories processed in {1} msec", directoryCount, totalTime.Elapsed.TotalSeconds);
}
private void CompileDirectory(CompilationContext context, string viewDirectory) {