Free cookie consent management tool by TermsFeed Policy Generator

source: branches/OaaS/HeuristicLab.Services.Optimization.Web/WebRole.cs @ 9045

Last change on this file since 9045 was 8958, checked in by fschoepp, 12 years ago

#1888:

  • Added a administrator web interface for job management
  • Fixed Hive Client (PluginValidator) to find the assemblies within the right directories
  • Reorganized controller classes (Folders HL, Interfaces, Azure)
  • You may now successfully schedule and run jobs with the web ui.
File size: 1.3 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using Microsoft.WindowsAzure;
5using Microsoft.WindowsAzure.Diagnostics;
6using Microsoft.WindowsAzure.ServiceRuntime;
7
8namespace HeuristicLab.Services.Optimization.Web {
9  public static class Constants {
10    public const string DiagnosticsConnectionString = "Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString";
11  }
12
13  public class WebRole : RoleEntryPoint {
14    public override bool OnStart() {
15      // For information on handling configuration changes
16      // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.     
17      try {
18        if (!String.IsNullOrEmpty(RoleEnvironment.GetConfigurationSettingValue(Constants.DiagnosticsConnectionString))) {
19          DiagnosticMonitorConfiguration dmc = DiagnosticMonitor.GetDefaultInitialConfiguration();
20          dmc.Logs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);
21          dmc.Logs.ScheduledTransferLogLevelFilter = LogLevel.Verbose;
22          DiagnosticMonitor.Start(Constants.DiagnosticsConnectionString, dmc);
23        }
24      }
25      catch (RoleEnvironmentException ex) {
26        // diagnostics connection string not in configuration
27        // -> diagnostics disabled
28        // nothing more to do
29      }
30
31      return base.OnStart();
32    }
33  }
34}
Note: See TracBrowser for help on using the repository browser.