Index: /branches/HiveStatistics/sources/HeuristicLab.Clients.Hive/3.3/HiveClient.cs
===================================================================
--- /branches/HiveStatistics/sources/HeuristicLab.Clients.Hive/3.3/HiveClient.cs	(revision 9645)
+++ /branches/HiveStatistics/sources/HeuristicLab.Clients.Hive/3.3/HiveClient.cs	(revision 9646)
@@ -438,5 +438,5 @@
 
         refreshableJob.Progress.Status = "Downloading tasks...";
-        downloader = new TaskDownloader(allTasks.Select(x => x.Id), refreshableJob.Log);
+        downloader = new TaskDownloader(allTasks.Select(x => x.Id));
         downloader.StartAsync();
 
Index: /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Code/ChartHelper.cshtml
===================================================================
--- /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Code/ChartHelper.cshtml	(revision 9645)
+++ /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Code/ChartHelper.cshtml	(revision 9646)
@@ -1,4 +1,4 @@
 ﻿@* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -35,7 +35,5 @@
 }
 
-@helper LineChartTime(string destinationTag, string url, string title = "",
-    double? minY = null, double? maxY = null, string axisYFormat = null) {
-        
+@helper LineChartTime(string destinationTag, string url, string title = "", double? minY = null, double? maxY = null, string axisYFormat = null) {
     <script>
         var @(destinationTag)Plot = $.jqplot("@destinationTag", "@url", {
@@ -46,6 +44,5 @@
             },
             seriesDefaults: {
-                markerOptions: { show: false },
-                //fill: true
+                markerOptions: { show: false }
             },
             dataRenderer: ajaxDataRenderer,
@@ -97,9 +94,11 @@
 
 @helper RefreshChart(string destinationTag, string url, string startDateVar, string endDateVar) {
-    @:$.ajax({url: "@(new HtmlString(url))?start=" + @startDateVar + "&end=" + @endDateVar, datatype: "json", success: function(result) {
-    @:    for (var i = 0; i < result.length; i++) {
-    @:        @(destinationTag)Plot.series[i].data = result[i];
-    @:    }
-    @:    @(destinationTag)Plot.replot({ resetAxes: true })
-    @:}});
+    <text>
+    $.ajax({url: "@(new HtmlString(url))?start=" + @startDateVar + "&end=" + @endDateVar, datatype: "json", success: function(result) {
+        for (var i = 0; i < result.length; i++) {
+            @(destinationTag)Plot.series[i].data = result[i];
+        }
+        @(destinationTag)Plot.replot({ resetAxes: true })
+    }});
+    </text>
 }
Index: /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Start/BundleConfig.cs
===================================================================
--- /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Start/BundleConfig.cs	(revision 9645)
+++ /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Start/BundleConfig.cs	(revision 9646)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
Index: /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Start/FilterConfig.cs
===================================================================
--- /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Start/FilterConfig.cs	(revision 9645)
+++ /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Start/FilterConfig.cs	(revision 9646)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
Index: /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Start/RouteConfig.cs
===================================================================
--- /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Start/RouteConfig.cs	(revision 9645)
+++ /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Start/RouteConfig.cs	(revision 9646)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
Index: /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Content/Site.css
===================================================================
--- /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Content/Site.css	(revision 9645)
+++ /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Content/Site.css	(revision 9646)
@@ -75,5 +75,5 @@
 
 #login a:hover {
-  color: #333;
+  color: gray;
 }
 
@@ -163,4 +163,5 @@
   margin: 1em 0;
   padding: 1em;
+  padding-top: 0;
   border: 1px solid #CCC;
 }
Index: /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Controllers/AccountController.cs
===================================================================
--- /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Controllers/AccountController.cs	(revision 9645)
+++ /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Controllers/AccountController.cs	(revision 9646)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
Index: /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Controllers/ChartDataController.cs
===================================================================
--- /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Controllers/ChartDataController.cs	(revision 9645)
+++ /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Controllers/ChartDataController.cs	(revision 9646)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
Index: /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Controllers/HomeController.cs
===================================================================
--- /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Controllers/HomeController.cs	(revision 9645)
+++ /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Controllers/HomeController.cs	(revision 9646)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
Index: /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Global.asax.cs
===================================================================
--- /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Global.asax.cs	(revision 9645)
+++ /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Global.asax.cs	(revision 9646)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
Index: /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Helper/HtmMenulHelper.cs
===================================================================
--- /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Helper/HtmMenulHelper.cs	(revision 9645)
+++ /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Helper/HtmMenulHelper.cs	(revision 9646)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
Index: /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Models/AccountModels.cs
===================================================================
--- /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Models/AccountModels.cs	(revision 9645)
+++ /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Models/AccountModels.cs	(revision 9646)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
Index: /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Properties/AssemblyInfo.cs.frame
===================================================================
--- /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Properties/AssemblyInfo.cs.frame	(revision 9645)
+++ /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Properties/AssemblyInfo.cs.frame	(revision 9646)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -32,5 +32,5 @@
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("HeuristicLab")]
-[assembly: AssemblyCopyright("(c) 2002-2012 HEAL")]
+[assembly: AssemblyCopyright("(c) 2002-2013 HEAL")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
Index: /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Scripts/jqPlot/plugins/jqplot.dateAxisRenderer.js
===================================================================
--- /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Scripts/jqPlot/plugins/jqplot.dateAxisRenderer.js	(revision 9645)
+++ /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Scripts/jqPlot/plugins/jqplot.dateAxisRenderer.js	(revision 9646)
Index: /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Views/Home/Index.cshtml
===================================================================
--- /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Views/Home/Index.cshtml	(revision 9645)
+++ /branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Views/Home/Index.cshtml	(revision 9646)
@@ -111,15 +111,4 @@
             var startDate = $('#Start').val();
             var endDate = $('#End').val();
-            
-                        @*
-            var url = "@Url.Action("AverageCpuUtilization", "ChartData")?start=" + startDate + "&end" + endDate;
-            
-            @ChartHelper.LineChartTime(
-                "AverageCpuUtilization",
-                "url",
-                title: "Avg. CPU Utilization History of all Slaves",
-                axisYFormat: "%.2f%%",
-                minY: 0, maxY: 100)
-            *@
 
             @ChartHelper.RefreshChart("AverageCpuUtilization", Url.Action("AverageCpuUtilization", "ChartData"), "startDate", "endDate")
Index: /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/HiveStatisticsGenerator.cs
===================================================================
--- /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/HiveStatisticsGenerator.cs	(revision 9645)
+++ /branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/HiveStatisticsGenerator.cs	(revision 9646)
@@ -1,4 +1,5 @@
 ﻿using System;
 using System.Collections.Generic;
+using System.Data.Linq;
 using System.Linq;
 using System.Transactions;
@@ -8,5 +9,4 @@
 namespace HeuristicLab.Services.Hive {
   public class HiveStatisticsGenerator : IStatisticsGenerator {
-
     private IUserManager userManager { get { return ServiceLocator.Instance.UserManager; } }
 
@@ -22,5 +22,11 @@
         if (newTime != null) {
           UpdateFactTables(newTime, db);
-          db.SubmitChanges();
+          try {
+            db.SubmitChanges();
+          }
+          catch (DuplicateKeyException) {
+            // Propable change from summertime to wintertime, resulting in overlapping times
+            // On wintertime to summertime change, slave timeouts and a fact gap will occur
+          }
         }
 
@@ -31,5 +37,5 @@
     private DimTime UpdateDimensionTables(HiveDataContext db) {
       var newTime = UpdateTime(db);
-      // Update other tables out of sync with time dimension?
+
       UpdateUsers(db);
       UpdateJobs(db);
@@ -155,4 +161,6 @@
 
     private void UpdateClientInfoFacts(DimTime newTime, HiveDataContext db) {
+      var time = newTime.Time;
+
       var lastFacts =
         from cf in db.FactClientInfos
@@ -178,46 +186,30 @@
       var clientFacts =
         from s in slaves.ToList()
+        let duration = s.LastFact != null ? (time - s.LastFact.Time).TotalMinutes : SmallestTimeSpan.TotalMinutes
         select new FactClientInfo {
           DimClient = s.Client,
           DimTime = newTime,
           UserId = s.Slave.OwnerUserId ?? Guid.Empty,
-          NumUsedCores =
-            s.Slave.Cores != null && s.Slave.FreeCores != null
-              ? s.Slave.Cores.Value - s.Slave.FreeCores.Value
-              : 0,
+          NumUsedCores = s.Slave.Cores != null && s.Slave.FreeCores != null
+                         ? s.Slave.Cores.Value - s.Slave.FreeCores.Value : 0,
           NumTotalCores = s.Slave.Cores ?? 0,
-          UsedMemory =
-            s.Slave.Memory != null && s.Slave.FreeMemory != null
-              ? s.Slave.Memory.Value - s.Slave.FreeMemory.Value
-              : 0,
+          UsedMemory = s.Slave.Memory != null && s.Slave.FreeMemory != null
+                       ? s.Slave.Memory.Value - s.Slave.FreeMemory.Value : 0,
           TotalMemory = s.Slave.Memory ?? 0,
           CpuUtilization = s.Slave.CpuUtilization,
           TrafficIn = 0,
           TrafficOut = 0,
-          TotalTimeIdle = CalcNewTotalTime(s.LastFact, newTime.Time,
-                                           x => x.TotalTimeIdle,
-                                           () => s.Slave.SlaveState == SlaveState.Idle && s.Slave.IsAllowedToCalculate),
-          TotalTimeCalculating = CalcNewTotalTime(s.LastFact, newTime.Time,
-                                                  x => x.TotalTimeCalculating,
-                                                  () => s.Slave.SlaveState == SlaveState.Calculating),
+          TotalTimeIdle = s.Slave.SlaveState == SlaveState.Idle && s.Slave.IsAllowedToCalculate
+                                  ? duration : 0.0,
+          TotalTimeCalculating = s.Slave.SlaveState == SlaveState.Calculating
+                                  ? duration : 0.0,
           TotalTimeTransferring = 0.0,
-          TotalTimeUnavailable = CalcNewTotalTime(s.LastFact, newTime.Time,
-                                                  x => x.TotalTimeUnavailable,
-                                                  () => s.Slave.SlaveState == SlaveState.Idle && !s.Slave.IsAllowedToCalculate),
-          TotalTimeOffline = CalcNewTotalTime(s.LastFact, newTime.Time,
-                                              x => x.TotalTimeOffline,
-                                              () => s.Slave.SlaveState == SlaveState.Offline)
+          TotalTimeUnavailable = s.Slave.SlaveState == SlaveState.Idle && !s.Slave.IsAllowedToCalculate
+                                  ? duration : 0.0,
+          TotalTimeOffline = s.Slave.SlaveState == SlaveState.Offline
+                                  ? duration : 0.0
         };
 
       db.FactClientInfos.InsertAllOnSubmit(clientFacts);
-    }
-
-    private double CalcNewTotalTime(FactClientInfo lastFact, DateTime newTime, Func<FactClientInfo, double> selector, Func<bool> condition) {
-      if (lastFact == null) {
-        return 0.0;
-      }
-      return condition()
-               ? selector(lastFact) + (newTime - lastFact.Time).TotalMinutes
-               : selector(lastFact);
     }
 
@@ -262,11 +254,9 @@
           TaskSize = t.LastFact == null ? t.TaskDataSize : t.LastFact.TaskSize,
           ResultSize = t.Task.State == TaskState.Finished ? t.TaskDataSize : default(long?),
-          NumCalculationRuns = stateLogsLinkedList.EnumerateNodes()
-            .Count(sl => sl.Value.State == TaskState.Calculating && sl.NextIs(nsl => nsl.State == TaskState.Transferring)),
-          NumRetries = stateLogsLinkedList.EnumerateNodes()
-            .Count(sl => sl.Value.State == TaskState.Calculating && sl.Next != null && sl.NextIs(nsl => nsl.State != TaskState.Transferring)),
-          TotalWaitingTime = SumTotalTime(stateLogsLinkedList, stateLog => stateLog.Value.State == TaskState.Waiting),
-          TotalRuntime = SumTotalTime(stateLogsLinkedList, stateLog => stateLog.Value.State == TaskState.Calculating && stateLog.NextIs(x => x.State == TaskState.Transferring)),
-          TotalTransferTime = SumTotalTime(stateLogsLinkedList, stateLog => stateLog.Value.State == TaskState.Transferring),
+          NumCalculationRuns = stateLogsLinkedList.CountCalculationRuns(),
+          NumRetries = stateLogsLinkedList.CountRetries(),
+          TotalWaitingTime = stateLogsLinkedList.SumTotalTimeWhere(stateLog => stateLog.Value.State == TaskState.Waiting),
+          TotalRuntime = stateLogsLinkedList.SumTotalTimeWhere(stateLog => stateLog.Value.State == TaskState.Calculating && stateLog.NextIs(x => x.State == TaskState.Transferring)),
+          TotalTransferTime = stateLogsLinkedList.SumTotalTimeWhere(stateLog => stateLog.Value.State == TaskState.Transferring),
           TaskState = t.Task.State
         };
@@ -275,13 +265,25 @@
       db.FactTasks.InsertAllOnSubmit(newTaskFacts);
     }
-
-    private double SumTotalTime(LinkedList<StateLog> stateLogs, Predicate<LinkedListNode<StateLog>> predicate) {
+  }
+
+  public static class StateLogLinkedListExtensions {
+    public static int CountCalculationRuns(this LinkedList<StateLog> stateLogs) {
       return stateLogs.EnumerateNodes()
-                      .Where(sl => predicate(sl))
-                      .Sum(stateLog => stateLog.Next != null ? (stateLog.Next.Value.DateTime - stateLog.Value.DateTime).TotalMinutes : 0);
+                      .Count(sl => sl.Value.State == TaskState.Calculating && sl.NextIs(nsl => nsl.State == TaskState.Transferring));
+    }
+
+    public static int CountRetries(this LinkedList<StateLog> stateLogs) {
+      return stateLogs.EnumerateNodes()
+                      .Count(sl => sl.Value.State == TaskState.Calculating && sl.Next != null && sl.NextIs(nsl => nsl.State != TaskState.Transferring));
+    }
+
+    public static double SumTotalTimeWhere(this LinkedList<StateLog> stateLogs, Predicate<LinkedListNode<StateLog>> predicate) {
+      return stateLogs.EnumerateNodes()
+                      .Where(stateLog => predicate(stateLog))
+                      .Sum(stateLog => stateLog.Next != null ? (stateLog.Next.Value.DateTime - stateLog.Value.DateTime).TotalMinutes : 0.0);
     }
   }
 
-  public static class LinkedListNodeExtensions {
+  public static class LinkedListExtensions {
     public static IEnumerable<LinkedListNode<T>> EnumerateNodes<T>(this LinkedList<T> list) {
       var node = list.First;
