Index: /branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.HiveEngine/3.3/HiveEngine.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.HiveEngine/3.3/HiveEngine.cs	(revision 5393)
+++ /branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.HiveEngine/3.3/HiveEngine.cs	(revision 5394)
@@ -39,4 +39,16 @@
       set { priority = value; }
     }
+
+    [Storable]
+    private TimeSpan executionTimeOnHive;
+    public TimeSpan ExecutionTimeOnHive {
+      get { return executionTimeOnHive; }
+      set {
+        if (value != executionTimeOnHive) {
+          executionTimeOnHive = value;
+          OnExecutionTimeOnHiveChanged();
+        }
+      }
+    }
     
     #region constructors and cloning
@@ -44,4 +56,5 @@
       ResourceIds = "HEAL";
     }
+
     [StorableConstructor]
     protected HiveEngine(bool deserializing) : base(deserializing) { }
@@ -51,7 +64,21 @@
       this.currentOperator = cloner.Clone(original.currentOperator);
       this.priority = original.priority;
+      this.executionTimeOnHive = original.executionTimeOnHive;
     }
     public override IDeepCloneable Clone(Cloner cloner) {
       return new HiveEngine(this, cloner);
+    }
+    #endregion
+
+    #region Events
+    protected override void OnPrepared() {
+      base.OnPrepared();
+      this.ExecutionTimeOnHive = TimeSpan.Zero;
+    }
+
+    public event EventHandler ExecutionTimeOnHiveChanged;
+    protected virtual void OnExecutionTimeOnHiveChanged() {
+      var handler = ExecutionTimeOnHiveChanged;
+      if (handler != null) handler(this, EventArgs.Empty);
     }
     #endregion
@@ -158,7 +185,7 @@
       IScope[] scopes = new Scope[jobs.Length];
       object locker = new object();
+      IDictionary<Guid, int> jobIndices = new Dictionary<Guid, int>();
 
       try {
-        IDictionary<Guid, int> jobIndices = new Dictionary<Guid, int>();
         List<Guid> remainingJobIds = new List<Guid>();
         JobResultList results;
@@ -203,5 +230,5 @@
             }
             jobs[key] = null; // relax memory
-            LogMessage(string.Format("Submitted job #{0}", key + 1, jobDto.Id));
+            LogMessage(string.Format("Uploaded job #{0}", key + 1, jobDto.Id));
             uploadTasks.Remove(task);
           }
@@ -212,4 +239,5 @@
         var downloadTasks = new List<Task<OperationJob>>();
         var executionTimes = new List<TimeSpan>();
+        var executionTimeOnHiveBefore = executionTimeOnHive;
         while (processUploadedJobsTask.Status != TaskStatus.RanToCompletion || remainingJobIds.Count > 0) {
           cancellationToken.ThrowIfCancellationRequested();
@@ -222,6 +250,7 @@
             var jobsFinished = results.Where(j => j.State == JobState.Finished || j.State == JobState.Failed || j.State == JobState.Aborted);
             finishedCount += jobsFinished.Count();
-            var totalExecutionTime = TimeSpan.FromMilliseconds(results.Select(j => j.ExecutionTime).Union(executionTimes).Select(e => e.TotalMilliseconds).Sum());
-            LogMessage(string.Format("Results polled. Jobs finished: {0}/{1}, TotalExecutionTime: {2}", finishedCount, jobs.Length, totalExecutionTime));
+            if (jobsFinished.Count() > 0) LogMessage(string.Format("Finished: {0}/{1}", finishedCount, jobs.Length));
+            ExecutionTimeOnHive = executionTimeOnHiveBefore + executionTimes.Sum() + results.Select(x => x.ExecutionTime).Sum();
+
             foreach (var result in jobsFinished) {
               if (result.State == JobState.Finished) {
@@ -232,5 +261,5 @@
                 LogMessage(string.Format("Job #{0} aborted (id: {1})", jobIndices[result.Id] + 1, result.Id));
               } else if (result.State == JobState.Failed) {
-                LogMessage(string.Format("Job {0} failed (id: {1}): {2}", jobIndices[result.Id] + 1, result.Id, result.Exception));
+                LogMessage(string.Format("Job #{0} failed (id: {1}): {2}", jobIndices[result.Id] + 1, result.Id, result.Exception));
               }
               remainingJobIds.Remove(result.Id);
@@ -259,18 +288,33 @@
         }
 
-        LogMessage(string.Format("All jobs finished (TotalExecutionTime: {0}). Deleting jobs on hive.", TimeSpan.FromMilliseconds(executionTimes.Select(e => e.TotalMilliseconds).Sum())));
-        // delete jobs
+        LogMessage(string.Format("All jobs finished (TotalExecutionTime: {0}).", executionTimes.Sum()));
+        DeleteJobs(jobIndices);
+
+        return scopes;
+      }
+      catch (OperationCanceledException e) {
+        lock (locker) {
+          if (jobIndices != null) DeleteJobs(jobIndices);
+        }
+        throw e;
+      }
+      catch (Exception e) {
+        lock (locker) {
+          if (jobIndices != null) DeleteJobs(jobIndices);
+        }
+        LogException(e);
+        throw e;
+      }
+    }
+
+    private void DeleteJobs(IDictionary<Guid, int> jobIndices) {
+      if (jobIndices.Count > 0) {
         using (Disposable<IClientFacade> service = ServiceLocator.Instance.ClientFacadePool.GetService()) {
           foreach (Guid jobId in jobIndices.Keys) {
             service.Obj.DeleteJob(jobId);
           }
-        }
-
-        LogMessage(string.Format("Operations on the hive finished.", jobs.Length));
-        return scopes;
-      }
-      catch (Exception e) {
-        LogException(e);
-        throw e;
+          LogMessage(string.Format("Deleted {0} jobs on hive.", jobIndices.Count));
+          jobIndices.Clear();
+        }
       }
     }
@@ -395,3 +439,9 @@
     }
   }
+
+  public static class EnumerableExtensions {
+    public static TimeSpan Sum(this IEnumerable<TimeSpan> times) {
+      return TimeSpan.FromMilliseconds(times.Select(e => e.TotalMilliseconds).Sum());
+    }
+  }
 }
Index: /branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.HiveEngine/3.3/Views/HiveEngineView.Designer.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.HiveEngine/3.3/Views/HiveEngineView.Designer.cs	(revision 5393)
+++ /branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.HiveEngine/3.3/Views/HiveEngineView.Designer.cs	(revision 5394)
@@ -28,15 +28,21 @@
       this.priorityLabel = new System.Windows.Forms.Label();
       this.priorityTextBox = new System.Windows.Forms.TextBox();
+      this.label1 = new System.Windows.Forms.Label();
+      this.executionTimeOnHiveTextBox = new System.Windows.Forms.TextBox();
       this.SuspendLayout();
+      // 
+      // executionTimeTextBox
+      // 
+      this.executionTimeTextBox.Size = new System.Drawing.Size(623, 20);
       // 
       // logView
       // 
-      this.logView.Location = new System.Drawing.Point(0, 81);
-      this.logView.Size = new System.Drawing.Size(430, 270);
+      this.logView.Location = new System.Drawing.Point(0, 78);
+      this.logView.Size = new System.Drawing.Size(715, 469);
       // 
       // resourceIdsLabel
       // 
       this.resourceIdsLabel.AutoSize = true;
-      this.resourceIdsLabel.Location = new System.Drawing.Point(3, 26);
+      this.resourceIdsLabel.Location = new System.Drawing.Point(113, 55);
       this.resourceIdsLabel.Name = "resourceIdsLabel";
       this.resourceIdsLabel.Size = new System.Drawing.Size(70, 13);
@@ -46,7 +52,10 @@
       // resourceIdsTextBox
       // 
-      this.resourceIdsTextBox.Location = new System.Drawing.Point(73, 23);
+      this.resourceIdsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.resourceIdsTextBox.Location = new System.Drawing.Point(189, 52);
       this.resourceIdsTextBox.Name = "resourceIdsTextBox";
-      this.resourceIdsTextBox.Size = new System.Drawing.Size(357, 20);
+      this.resourceIdsTextBox.Size = new System.Drawing.Size(526, 20);
       this.resourceIdsTextBox.TabIndex = 4;
       this.resourceIdsTextBox.Text = "HEAL";
@@ -56,5 +65,5 @@
       // 
       this.priorityLabel.AutoSize = true;
-      this.priorityLabel.Location = new System.Drawing.Point(3, 49);
+      this.priorityLabel.Location = new System.Drawing.Point(3, 55);
       this.priorityLabel.Name = "priorityLabel";
       this.priorityLabel.Size = new System.Drawing.Size(41, 13);
@@ -64,9 +73,30 @@
       // priorityTextBox
       // 
-      this.priorityTextBox.Location = new System.Drawing.Point(73, 46);
+      this.priorityTextBox.Location = new System.Drawing.Point(50, 52);
       this.priorityTextBox.Name = "priorityTextBox";
-      this.priorityTextBox.Size = new System.Drawing.Size(357, 20);
+      this.priorityTextBox.Size = new System.Drawing.Size(57, 20);
       this.priorityTextBox.TabIndex = 6;
+      this.priorityTextBox.Text = "0";
       this.priorityTextBox.TextChanged += new System.EventHandler(this.priorityTextBox_TextChanged);
+      // 
+      // label1
+      // 
+      this.label1.AutoSize = true;
+      this.label1.Location = new System.Drawing.Point(3, 29);
+      this.label1.Name = "label1";
+      this.label1.Size = new System.Drawing.Size(123, 13);
+      this.label1.TabIndex = 7;
+      this.label1.Text = "Execution Time on Hive:";
+      // 
+      // executionTimeOnHiveTextBox
+      // 
+      this.executionTimeOnHiveTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.executionTimeOnHiveTextBox.Location = new System.Drawing.Point(129, 26);
+      this.executionTimeOnHiveTextBox.Name = "executionTimeOnHiveTextBox";
+      this.executionTimeOnHiveTextBox.ReadOnly = true;
+      this.executionTimeOnHiveTextBox.Size = new System.Drawing.Size(586, 20);
+      this.executionTimeOnHiveTextBox.TabIndex = 8;
       // 
       // HiveEngineView
@@ -74,16 +104,21 @@
       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.label1);
+      this.Controls.Add(this.executionTimeOnHiveTextBox);
+      this.Controls.Add(this.priorityTextBox);
+      this.Controls.Add(this.priorityLabel);
+      this.Controls.Add(this.resourceIdsLabel);
       this.Controls.Add(this.resourceIdsTextBox);
-      this.Controls.Add(this.priorityTextBox);
-      this.Controls.Add(this.resourceIdsLabel);
-      this.Controls.Add(this.priorityLabel);
       this.Name = "HiveEngineView";
+      this.Size = new System.Drawing.Size(715, 550);
+      this.Controls.SetChildIndex(this.resourceIdsTextBox, 0);
+      this.Controls.SetChildIndex(this.resourceIdsLabel, 0);
       this.Controls.SetChildIndex(this.priorityLabel, 0);
-      this.Controls.SetChildIndex(this.resourceIdsLabel, 0);
       this.Controls.SetChildIndex(this.priorityTextBox, 0);
-      this.Controls.SetChildIndex(this.resourceIdsTextBox, 0);
       this.Controls.SetChildIndex(this.logView, 0);
       this.Controls.SetChildIndex(this.executionTimeLabel, 0);
       this.Controls.SetChildIndex(this.executionTimeTextBox, 0);
+      this.Controls.SetChildIndex(this.executionTimeOnHiveTextBox, 0);
+      this.Controls.SetChildIndex(this.label1, 0);
       this.ResumeLayout(false);
       this.PerformLayout();
@@ -97,4 +132,6 @@
     private System.Windows.Forms.Label priorityLabel;
     private System.Windows.Forms.TextBox priorityTextBox;
+    private System.Windows.Forms.Label label1;
+    protected System.Windows.Forms.TextBox executionTimeOnHiveTextBox;
   }
 }
Index: /branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.HiveEngine/3.3/Views/HiveEngineView.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.HiveEngine/3.3/Views/HiveEngineView.cs	(revision 5393)
+++ /branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.HiveEngine/3.3/Views/HiveEngineView.cs	(revision 5394)
@@ -24,4 +24,5 @@
 
     protected override void DeregisterContentEvents() {
+      Content.ExecutionTimeOnHiveChanged -= new EventHandler(Content_ExecutionTimeOnHiveChanged);
       base.DeregisterContentEvents();
     }
@@ -29,8 +30,15 @@
     protected override void RegisterContentEvents() {
       base.RegisterContentEvents();
+      Content.ExecutionTimeOnHiveChanged += new EventHandler(Content_ExecutionTimeOnHiveChanged);
     }
 
     #region Event Handlers (Content)
-    // Put event handlers of the content here
+    private void Content_ExecutionTimeOnHiveChanged(object sender, EventArgs e) {
+      if (InvokeRequired) {
+        Invoke(new EventHandler(Content_ExecutionTimeOnHiveChanged), sender, e);
+      } else {
+        executionTimeOnHiveTextBox.Text = Content.ExecutionTimeOnHive.ToString();
+      }
+    }
     #endregion
 
@@ -40,10 +48,11 @@
         resourceIdsTextBox.Text = string.Empty;
         priorityTextBox.Text = string.Empty;
+        executionTimeOnHiveTextBox.Text = string.Empty;
       } else {
         resourceIdsTextBox.Text = Content.ResourceIds;
         priorityTextBox.Text = Content.Priority.ToString();
+        executionTimeOnHiveTextBox.Text = Content.ExecutionTimeOnHive.ToString();
       }
     }
-
 
     protected override void SetEnabledStateOfControls() {
