- Timestamp:
- 06/12/15 17:04:39 (9 years ago)
- Location:
- branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/HeuristicLab.Services.Hive-3.3.csproj
r11623 r12441 143 143 <Compile Include="DataTransfer\Statistics.cs" /> 144 144 <Compile Include="DataTransfer\UserStatistics.cs" /> 145 <Compile Include="HiveStatisticsGenerator.cs" /> 146 <Compile Include="Interfaces\IStatisticsGenerator.cs" /> 145 147 <Compile Include="OptimizedHiveDao.cs" /> 146 148 <Compile Include="HiveDao.cs" /> -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/HiveJanitor.cs
r12012 r12441 27 27 public class HiveJanitor { 28 28 private bool stop; 29 private AutoResetEvent waitHandle; 29 private AutoResetEvent cleanupWaitHandle; 30 private AutoResetEvent generateStatisticsWaitHandle; 30 31 31 32 private DataAccess.ITransactionManager trans { … … 37 38 } 38 39 40 private IStatisticsGenerator statisticsGenerator { 41 get { return ServiceLocator.Instance.StatisticsGenerator; } 42 } 43 39 44 private IHiveDao dao { 40 45 get { return ServiceLocator.Instance.HiveDao; } … … 43 48 public HiveJanitor() { 44 49 stop = false; 45 waitHandle = new AutoResetEvent(true); 50 cleanupWaitHandle = new AutoResetEvent(true); 51 generateStatisticsWaitHandle = new AutoResetEvent(true); 46 52 } 47 53 48 54 public void StopJanitor() { 49 55 stop = true; 50 waitHandle.Set();56 cleanupWaitHandle.Set(); 51 57 } 52 58 53 public void Run () {59 public void RunCleanup() { 54 60 while (!stop) { 55 61 try { … … 72 78 LogFactory.GetLogger(typeof(HiveJanitor).Namespace).Log(string.Format("HiveJanitor: The following exception occured: {0}", e.ToString())); 73 79 } 74 waitHandle.WaitOne(HeuristicLab.Services.Hive.Properties.Settings.Default.CleanupInterval);80 cleanupWaitHandle.WaitOne(HeuristicLab.Services.Hive.Properties.Settings.Default.CleanupInterval); 75 81 } 76 waitHandle.Close(); 82 cleanupWaitHandle.Close(); 83 } 84 85 public void RunGenerateStatistics() { 86 while (!stop) { 87 try { 88 LogFactory.GetLogger(typeof(HiveJanitor).Namespace).Log("HiveJanitor: starting generate statistics"); 89 statisticsGenerator.GenerateStatistics(); 90 LogFactory.GetLogger(typeof(HiveJanitor).Namespace).Log("HiveJanitor: generate statistics finished"); 91 } 92 catch (Exception e) { 93 LogFactory.GetLogger(typeof(HiveJanitor).Namespace).Log(string.Format("HiveJanitor: The following exception occured: {0}", e)); 94 } 95 96 generateStatisticsWaitHandle.WaitOne(Properties.Settings.Default.GenerateStatisticsInterval); 97 } 98 99 generateStatisticsWaitHandle.Close(); 77 100 } 78 101 } -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/Interfaces/IServiceLocator.cs
r12012 r12441 29 29 IOptimizedHiveDao OptimizedHiveDao { get; } 30 30 IEventManager EventManager { get; } 31 IStatisticsGenerator StatisticsGenerator { get; } 31 32 ITransactionManager TransactionManager { get; } 32 33 Access.IUserManager UserManager { get; } -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/Properties/Settings.Designer.cs
r11623 r12441 10 10 11 11 namespace HeuristicLab.Services.Hive.Properties { 12 13 14 [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] 16 public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 18 private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 20 public static Settings Default { 21 get { 22 return defaultInstance; 23 } 24 } 25 26 [global::System.Configuration.ApplicationScopedSettingAttribute()] 27 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 [global::System.Configuration.DefaultSettingValueAttribute("00:03:00")] 29 public global::System.TimeSpan SlaveHeartbeatTimeout { 30 get { 31 return ((global::System.TimeSpan)(this["SlaveHeartbeatTimeout"])); 32 } 33 } 34 35 [global::System.Configuration.ApplicationScopedSettingAttribute()] 36 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 37 [global::System.Configuration.DefaultSettingValueAttribute("00:05:30")] 38 public global::System.TimeSpan CalculatingJobHeartbeatTimeout { 39 get { 40 return ((global::System.TimeSpan)(this["CalculatingJobHeartbeatTimeout"])); 41 } 42 } 43 44 [global::System.Configuration.ApplicationScopedSettingAttribute()] 45 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 46 [global::System.Configuration.DefaultSettingValueAttribute("00:15:00")] 47 public global::System.TimeSpan TransferringJobHeartbeatTimeout { 48 get { 49 return ((global::System.TimeSpan)(this["TransferringJobHeartbeatTimeout"])); 50 } 51 } 52 53 [global::System.Configuration.ApplicationScopedSettingAttribute()] 54 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 55 [global::System.Configuration.DefaultSettingValueAttribute("False")] 56 public bool TriggerEventManagerInHeartbeat { 57 get { 58 return ((bool)(this["TriggerEventManagerInHeartbeat"])); 59 } 60 } 61 62 [global::System.Configuration.ApplicationScopedSettingAttribute()] 63 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 64 [global::System.Configuration.DefaultSettingValueAttribute("00:03:00")] 65 public global::System.TimeSpan CleanupInterval { 66 get { 67 return ((global::System.TimeSpan)(this["CleanupInterval"])); 68 } 69 } 70 71 [global::System.Configuration.ApplicationScopedSettingAttribute()] 72 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 73 [global::System.Configuration.DefaultSettingValueAttribute("3.00:00:00")] 74 public global::System.TimeSpan SweepInterval { 75 get { 76 return ((global::System.TimeSpan)(this["SweepInterval"])); 77 } 78 } 79 80 [global::System.Configuration.ApplicationScopedSettingAttribute()] 81 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 82 [global::System.Configuration.DefaultSettingValueAttribute("00:00:20")] 83 public global::System.TimeSpan SchedulingPatience { 84 get { 85 return ((global::System.TimeSpan)(this["SchedulingPatience"])); 86 } 87 } 12 13 14 [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] 16 public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 18 private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 20 public static Settings Default { 21 get { 22 return defaultInstance; 23 } 88 24 } 25 26 [global::System.Configuration.ApplicationScopedSettingAttribute()] 27 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 [global::System.Configuration.DefaultSettingValueAttribute("00:03:00")] 29 public global::System.TimeSpan SlaveHeartbeatTimeout { 30 get { 31 return ((global::System.TimeSpan)(this["SlaveHeartbeatTimeout"])); 32 } 33 } 34 35 [global::System.Configuration.ApplicationScopedSettingAttribute()] 36 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 37 [global::System.Configuration.DefaultSettingValueAttribute("00:05:30")] 38 public global::System.TimeSpan CalculatingJobHeartbeatTimeout { 39 get { 40 return ((global::System.TimeSpan)(this["CalculatingJobHeartbeatTimeout"])); 41 } 42 } 43 44 [global::System.Configuration.ApplicationScopedSettingAttribute()] 45 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 46 [global::System.Configuration.DefaultSettingValueAttribute("00:15:00")] 47 public global::System.TimeSpan TransferringJobHeartbeatTimeout { 48 get { 49 return ((global::System.TimeSpan)(this["TransferringJobHeartbeatTimeout"])); 50 } 51 } 52 53 [global::System.Configuration.ApplicationScopedSettingAttribute()] 54 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 55 [global::System.Configuration.DefaultSettingValueAttribute("False")] 56 public bool TriggerEventManagerInHeartbeat { 57 get { 58 return ((bool)(this["TriggerEventManagerInHeartbeat"])); 59 } 60 } 61 62 [global::System.Configuration.ApplicationScopedSettingAttribute()] 63 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 64 [global::System.Configuration.DefaultSettingValueAttribute("00:03:00")] 65 public global::System.TimeSpan CleanupInterval { 66 get { 67 return ((global::System.TimeSpan)(this["CleanupInterval"])); 68 } 69 } 70 71 [global::System.Configuration.ApplicationScopedSettingAttribute()] 72 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 73 [global::System.Configuration.DefaultSettingValueAttribute("3.00:00:00")] 74 public global::System.TimeSpan SweepInterval { 75 get { 76 return ((global::System.TimeSpan)(this["SweepInterval"])); 77 } 78 } 79 80 [global::System.Configuration.ApplicationScopedSettingAttribute()] 81 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 82 [global::System.Configuration.DefaultSettingValueAttribute("00:00:20")] 83 public global::System.TimeSpan SchedulingPatience { 84 get { 85 return ((global::System.TimeSpan)(this["SchedulingPatience"])); 86 } 87 } 88 89 [global::System.Configuration.ApplicationScopedSettingAttribute()] 90 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 91 [global::System.Configuration.DefaultSettingValueAttribute("00:05:00")] 92 public global::System.TimeSpan GenerateStatisticsInterval { 93 get { 94 return ((global::System.TimeSpan)(this["GenerateStatisticsInterval"])); 95 } 96 } 97 } 89 98 } -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/ServiceLocator.cs
r12012 r12441 75 75 } 76 76 77 private IStatisticsGenerator statisticsGenerator; 78 public IStatisticsGenerator StatisticsGenerator { 79 get { return statisticsGenerator ?? (statisticsGenerator = new HiveStatisticsGenerator()); } 80 } 81 77 82 private ITransactionManager transactionManager; 78 83 public ITransactionManager TransactionManager {
Note: See TracChangeset
for help on using the changeset viewer.