Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/12/15 17:04:39 (9 years ago)
Author:
dglaser
Message:

#2388: Restored files/settings from old HiveStatistics branch

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  
    143143    <Compile Include="DataTransfer\Statistics.cs" />
    144144    <Compile Include="DataTransfer\UserStatistics.cs" />
     145    <Compile Include="HiveStatisticsGenerator.cs" />
     146    <Compile Include="Interfaces\IStatisticsGenerator.cs" />
    145147    <Compile Include="OptimizedHiveDao.cs" />
    146148    <Compile Include="HiveDao.cs" />
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/HiveJanitor.cs

    r12012 r12441  
    2727  public class HiveJanitor {
    2828    private bool stop;
    29     private AutoResetEvent waitHandle;
     29    private AutoResetEvent cleanupWaitHandle;
     30    private AutoResetEvent generateStatisticsWaitHandle;
    3031
    3132    private DataAccess.ITransactionManager trans {
     
    3738    }
    3839
     40    private IStatisticsGenerator statisticsGenerator {
     41      get { return ServiceLocator.Instance.StatisticsGenerator; }
     42    }
     43
    3944    private IHiveDao dao {
    4045      get { return ServiceLocator.Instance.HiveDao; }
     
    4348    public HiveJanitor() {
    4449      stop = false;
    45       waitHandle = new AutoResetEvent(true);
     50      cleanupWaitHandle = new AutoResetEvent(true);
     51      generateStatisticsWaitHandle = new AutoResetEvent(true);
    4652    }
    4753
    4854    public void StopJanitor() {
    4955      stop = true;
    50       waitHandle.Set();
     56      cleanupWaitHandle.Set();
    5157    }
    5258
    53     public void Run() {
     59    public void RunCleanup() {
    5460      while (!stop) {
    5561        try {
     
    7278          LogFactory.GetLogger(typeof(HiveJanitor).Namespace).Log(string.Format("HiveJanitor: The following exception occured: {0}", e.ToString()));
    7379        }
    74         waitHandle.WaitOne(HeuristicLab.Services.Hive.Properties.Settings.Default.CleanupInterval);
     80        cleanupWaitHandle.WaitOne(HeuristicLab.Services.Hive.Properties.Settings.Default.CleanupInterval);
    7581      }
    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();
    77100    }
    78101  }
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/Interfaces/IServiceLocator.cs

    r12012 r12441  
    2929    IOptimizedHiveDao OptimizedHiveDao { get; }
    3030    IEventManager EventManager { get; }
     31    IStatisticsGenerator StatisticsGenerator { get; }
    3132    ITransactionManager TransactionManager { get; }
    3233    Access.IUserManager UserManager { get; }
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/Properties/Settings.Designer.cs

    r11623 r12441  
    1010
    1111namespace 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      }
    8824    }
     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  }
    8998}
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/ServiceLocator.cs

    r12012 r12441  
    7575    }
    7676
     77    private IStatisticsGenerator statisticsGenerator;
     78    public IStatisticsGenerator StatisticsGenerator {
     79      get { return statisticsGenerator ?? (statisticsGenerator = new HiveStatisticsGenerator()); }
     80    }
     81
    7782    private ITransactionManager transactionManager;
    7883    public ITransactionManager TransactionManager {
Note: See TracChangeset for help on using the changeset viewer.