Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/19/12 15:15:15 (13 years ago)
Author:
spimming
Message:

#1680:

  • start diagnostic monitor only when a connection string is specified
  • constants file added
Location:
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.Slave.AzureClient
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.Slave.AzureClient/HeuristicLab.Clients.Hive.Slave.AzureClient.csproj

    r7215 r7371  
    6262  </ItemGroup>
    6363  <ItemGroup>
     64    <Compile Include="Constants.cs" />
    6465    <Compile Include="WorkerRole.cs" />
    6566    <Compile Include="Properties\AssemblyInfo.cs" />
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.Slave.AzureClient/WorkerRole.cs

    r7005 r7371  
    1818      while (true) {
    1919        Thread.Sleep(10000);
    20         //Trace.WriteLine("Working", "Information");
    2120      }
    2221    }
     
    2524      ServicePointManager.DefaultConnectionLimit = 12;
    2625      core = new Core();
    27 
    28       DiagnosticMonitorConfiguration dmc = DiagnosticMonitor.GetDefaultInitialConfiguration();
    29       dmc.Logs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);
    30       dmc.Logs.ScheduledTransferLogLevelFilter = LogLevel.Verbose;
    31       DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", dmc);
     26      try {
     27        if (!String.IsNullOrEmpty(RoleEnvironment.GetConfigurationSettingValue(Constants.DiagnosticsConnectionString))) {
     28          DiagnosticMonitorConfiguration dmc = DiagnosticMonitor.GetDefaultInitialConfiguration();
     29          dmc.Logs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);
     30          dmc.Logs.ScheduledTransferLogLevelFilter = LogLevel.Verbose;
     31          DiagnosticMonitor.Start(Constants.DiagnosticsConnectionString, dmc);
     32        }
     33      }
     34      catch (RoleEnvironmentException ex) {
     35        //diagnostics connectio string not in configuration
     36        //-> diagnostics disabled
     37        //nothing more to do
     38      }
    3239
    3340      return base.OnStart();
Note: See TracChangeset for help on using the changeset viewer.