Index: /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.JanitorService/3.3/JanitorService.cs
===================================================================
--- /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.JanitorService/3.3/JanitorService.cs	(revision 9525)
+++ /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.JanitorService/3.3/JanitorService.cs	(revision 9526)
@@ -26,5 +26,6 @@
   public partial class JanitorService : ServiceBase {
     private HiveJanitor janitor;
-    private Thread janitorThread;
+    private Thread janitorCleanupThread;
+    private Thread janitorGenerateStatisticsThread;
 
     public JanitorService() {
@@ -35,12 +36,19 @@
       janitor = new HiveJanitor();
 
-      janitorThread = new Thread(janitor.Run);
-      janitorThread.IsBackground = true; //dont keep app alive
-      janitorThread.Start();
+      janitorCleanupThread = new Thread(janitor.RunCleanup) {
+        IsBackground = true
+      };
+      janitorGenerateStatisticsThread = new Thread(janitor.RunGenerateStatistics) {
+        IsBackground = true
+      };
+
+      janitorCleanupThread.Start();
+      janitorGenerateStatisticsThread.Start();
     }
 
     protected override void OnStop() {
       janitor.StopJanitor();
-      janitorThread.Join();
+      janitorCleanupThread.Join();
+      janitorGenerateStatisticsThread.Join();
     }
   }
Index: /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/HeuristicLab.Services.Hive-3.3.csproj
===================================================================
--- /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/HeuristicLab.Services.Hive-3.3.csproj	(revision 9525)
+++ /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/HeuristicLab.Services.Hive-3.3.csproj	(revision 9526)
@@ -137,4 +137,6 @@
     <Compile Include="DataTransfer\Statistics.cs" />
     <Compile Include="DataTransfer\UserStatistics.cs" />
+    <Compile Include="HiveStatisticsGenerator.cs" />
+    <Compile Include="Interfaces\IStatisticsGenerator.cs" />
     <Compile Include="OptimizedHiveDao.cs" />
     <Compile Include="HiveDao.cs" />
Index: /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/HiveJanitor.cs
===================================================================
--- /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/HiveJanitor.cs	(revision 9525)
+++ /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/HiveJanitor.cs	(revision 9526)
@@ -27,5 +27,6 @@
   public class HiveJanitor {
     private bool stop;
-    private AutoResetEvent waitHandle;
+    private AutoResetEvent cleanupWaitHandle;
+    private AutoResetEvent generateStatisticsWaitHandle;
 
     private DataAccess.ITransactionManager trans {
@@ -37,4 +38,8 @@
     }
 
+    private IStatisticsGenerator statisticsGenerator {
+      get { return ServiceLocator.Instance.StatisticsGenerator; }
+    }
+
     private IHiveDao dao {
       get { return ServiceLocator.Instance.HiveDao; }
@@ -43,13 +48,14 @@
     public HiveJanitor() {
       stop = false;
-      waitHandle = new AutoResetEvent(true);
+      cleanupWaitHandle = new AutoResetEvent(true);
+      generateStatisticsWaitHandle = new AutoResetEvent(true);
     }
 
     public void StopJanitor() {
       stop = true;
-      waitHandle.Set();
+      cleanupWaitHandle.Set();
     }
 
-    public void Run() {
+    public void RunCleanup() {
       while (!stop) {
         try {
@@ -72,7 +78,24 @@
           LogFactory.GetLogger(typeof(HiveJanitor).Namespace).Log(string.Format("HiveJanitor: The following exception occured: {0}", e.ToString()));
         }
-        waitHandle.WaitOne(HeuristicLab.Services.Hive.Properties.Settings.Default.CleanupInterval);
+        cleanupWaitHandle.WaitOne(HeuristicLab.Services.Hive.Properties.Settings.Default.CleanupInterval);
       }
-      waitHandle.Close();
+      cleanupWaitHandle.Close();
+    }
+
+    public void RunGenerateStatistics() {
+      while (!stop) {
+        try {
+          LogFactory.GetLogger(typeof(HiveJanitor).Namespace).Log("HiveJanitor: starting generate statistics");
+          statisticsGenerator.GenerateStatistics();
+          LogFactory.GetLogger(typeof(HiveJanitor).Namespace).Log("HiveJanitor: generate statistics finished");
+        }
+        catch (Exception e) {
+          LogFactory.GetLogger(typeof(HiveJanitor).Namespace).Log(string.Format("HiveJanitor: The following exception occured: {0}", e));
+        }
+
+        generateStatisticsWaitHandle.WaitOne(Properties.Settings.Default.GenerateStatisticsInterval);
+      }
+
+      generateStatisticsWaitHandle.Close();
     }
   }
Index: /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/HiveStatisticsGenerator.cs
===================================================================
--- /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/HiveStatisticsGenerator.cs	(revision 9526)
+++ /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/HiveStatisticsGenerator.cs	(revision 9526)
@@ -0,0 +1,15 @@
+﻿namespace HeuristicLab.Services.Hive {
+  public class HiveStatisticsGenerator : IStatisticsGenerator {
+    public void GenerateStatistics() {
+      //throw new System.NotImplementedException();
+    }
+
+    private void UpdateDimensionTables() {
+
+    }
+
+    private void UpdateDataTables() {
+
+    }
+  }
+}
Index: /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/Interfaces/IServiceLocator.cs
===================================================================
--- /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/Interfaces/IServiceLocator.cs	(revision 9525)
+++ /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/Interfaces/IServiceLocator.cs	(revision 9526)
@@ -29,4 +29,5 @@
     IOptimizedHiveDao OptimizedHiveDao { get; }
     IEventManager EventManager { get; }
+    IStatisticsGenerator StatisticsGenerator { get; }
     ITransactionManager TransactionManager { get; }
     Access.IUserManager UserManager { get; }
Index: /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/Interfaces/IStatisticsGenerator.cs
===================================================================
--- /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/Interfaces/IStatisticsGenerator.cs	(revision 9526)
+++ /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/Interfaces/IStatisticsGenerator.cs	(revision 9526)
@@ -0,0 +1,26 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+namespace HeuristicLab.Services.Hive {
+  public interface IStatisticsGenerator {
+    void GenerateStatistics();
+  }
+}
Index: /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/Properties/Settings.Designer.cs
===================================================================
--- /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/Properties/Settings.Designer.cs	(revision 9525)
+++ /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/Properties/Settings.Designer.cs	(revision 9526)
@@ -2,5 +2,5 @@
 // <auto-generated>
 //     This code was generated by a tool.
-//     Runtime Version:4.0.30319.17929
+//     Runtime Version:4.0.30319.18034
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
@@ -86,4 +86,13 @@
             }
         }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("00:05:00")]
+        public global::System.TimeSpan GenerateStatisticsInterval {
+            get {
+                return ((global::System.TimeSpan)(this["GenerateStatisticsInterval"]));
+            }
+        }
     }
 }
Index: /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/Properties/Settings.settings
===================================================================
--- /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/Properties/Settings.settings	(revision 9525)
+++ /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/Properties/Settings.settings	(revision 9526)
@@ -24,4 +24,7 @@
       <Value Profile="(Default)">00:00:20</Value>
     </Setting>
+    <Setting Name="GenerateStatisticsInterval" Type="System.TimeSpan" Scope="Application">
+      <Value Profile="(Default)">00:05:00</Value>
+    </Setting>
   </Settings>
 </SettingsFile>
Index: /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/ServiceLocator.cs
===================================================================
--- /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/ServiceLocator.cs	(revision 9525)
+++ /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/ServiceLocator.cs	(revision 9526)
@@ -74,4 +74,9 @@
     }
 
+    private IStatisticsGenerator statisticsGenerator;
+    public IStatisticsGenerator StatisticsGenerator {
+      get { return statisticsGenerator ?? (statisticsGenerator = new HiveStatisticsGenerator()); }
+    }
+
     private ITransactionManager transactionManager;
     public ITransactionManager TransactionManager {
Index: /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/app.config
===================================================================
--- /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/app.config	(revision 9525)
+++ /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/app.config	(revision 9526)
@@ -29,4 +29,7 @@
                 <value>00:00:20</value>
             </setting>
+            <setting name="GenerateStatisticsInterval" serializeAs="String">
+                <value>00:05:00</value>
+            </setting>
         </HeuristicLab.Services.Hive.Properties.Settings>
     </applicationSettings>
