PERF: Adding various logging calls related to startup performance

--HG--
branch : 1.x
This commit is contained in:
Renaud Paquay
2011-05-12 10:47:08 -07:00
parent 03ddb80526
commit 130f9d3c80
7 changed files with 76 additions and 50 deletions

View File

@@ -59,6 +59,7 @@ namespace Orchard.Environment {
void IOrchardHost.Initialize() {
Logger.Information("Initializing");
BuildCurrent();
Logger.Information("Initialized");
}
void IOrchardHost.ReloadExtensions() {
@@ -98,19 +99,26 @@ namespace Orchard.Environment {
}
IEnumerable<ShellContext> CreateAndActivate() {
Logger.Information("Start creation of shells");
IEnumerable<ShellContext> result;
var allSettings = _shellSettingsManager.LoadSettings();
if (allSettings.Any()) {
return allSettings.Select(
result = allSettings.Select(
settings => {
var context = CreateShellContext(settings);
ActivateShell(context);
return context;
});
}
else {
var setupContext = CreateSetupContext();
ActivateShell(setupContext);
result = new[] {setupContext};
}
var setupContext = CreateSetupContext();
ActivateShell(setupContext);
return new[] { setupContext };
Logger.Information("Done creating shells");
return result;
}
private void ActivateShell(ShellContext context) {