Last change
on this file since 7317 was
7005,
checked in by spimming, 13 years ago
|
#1680:
- enable Remote Desktop Connection to roles
- adapt connection string for Azure Storage in cloud configuration
- add diagnostics to worker role
|
File size:
1.2 KB
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Net;
|
---|
3 | using System.Threading;
|
---|
4 | using HeuristicLab.Clients.Hive.SlaveCore;
|
---|
5 | using Microsoft.WindowsAzure.Diagnostics;
|
---|
6 | using Microsoft.WindowsAzure.ServiceRuntime;
|
---|
7 |
|
---|
8 | namespace HeuristicLab.Clients.Hive.Slave.AzureClient {
|
---|
9 | public class WorkerRole : RoleEntryPoint {
|
---|
10 | private Core core;
|
---|
11 | private Thread coreThread;
|
---|
12 |
|
---|
13 | public override void Run() {
|
---|
14 | core = new Core(false);
|
---|
15 | coreThread = new Thread(core.Start);
|
---|
16 | coreThread.Start();
|
---|
17 |
|
---|
18 | while (true) {
|
---|
19 | Thread.Sleep(10000);
|
---|
20 | //Trace.WriteLine("Working", "Information");
|
---|
21 | }
|
---|
22 | }
|
---|
23 |
|
---|
24 | public override bool OnStart() {
|
---|
25 | ServicePointManager.DefaultConnectionLimit = 12;
|
---|
26 | 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);
|
---|
32 |
|
---|
33 | return base.OnStart();
|
---|
34 | }
|
---|
35 |
|
---|
36 | public override void OnStop() {
|
---|
37 | core.Shutdown();
|
---|
38 | base.OnStop();
|
---|
39 | }
|
---|
40 | }
|
---|
41 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.