Fix for Bug 116284 - [RCP] Performance Tests Failing: RCP rcp.performance.EmptyWorkbenchPerfTest#testRestore() [close]
diff --git a/tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/performance/EmptyWorkbenchPerfTest.java b/tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/performance/EmptyWorkbenchPerfTest.java
index 5a09a6d..589ae0d 100644
--- a/tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/performance/EmptyWorkbenchPerfTest.java
+++ b/tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/performance/EmptyWorkbenchPerfTest.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,81 +13,94 @@
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.test.performance.Dimension;
 import org.eclipse.test.performance.Performance;
+import org.eclipse.test.performance.PerformanceMeter;
 import org.eclipse.test.performance.PerformanceTestCase;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.application.WorkbenchAdvisor;
-import org.eclipse.ui.tests.rcp.util.IPerformanceMeterArray;
-import org.eclipse.ui.tests.rcp.util.IntervalMeters;
-import org.eclipse.ui.tests.rcp.util.RestoreWorkbenchIntervalMonitor;
 import org.eclipse.ui.tests.rcp.util.OpenWorkbenchIntervalMonitor;
+import org.eclipse.ui.tests.rcp.util.RestoreWorkbenchIntervalMonitor;
 
 /**
  * @since 3.1
  */
 public class EmptyWorkbenchPerfTest extends PerformanceTestCase {
 
-    private static final int REPEAT_COUNT = 10;
+    private static final int REPEAT_COUNT = 25;
 
     public void testOpen() {
         Display display = PlatformUI.createDisplay();
-
         Performance perf = Performance.getDefault();
-
         String baseScenarioId = perf.getDefaultScenarioId(this);
-        IPerformanceMeterArray meters = new IntervalMeters(perf, baseScenarioId, OpenWorkbenchIntervalMonitor.intervalNames);
+        PerformanceMeter startupMeter = perf.createPerformanceMeter( baseScenarioId + " [open]"); 
+        PerformanceMeter shutdownMeter = perf.createPerformanceMeter( baseScenarioId + " [close]"); 
+
         tagAsSummary("Open RCP App", Dimension.CPU_TIME);
         for (int i = 0; i < REPEAT_COUNT; ++i ) {
-            meters.start(OpenWorkbenchIntervalMonitor.firstInterval);
+        	startupMeter.start();
             int code = PlatformUI.createAndRunWorkbench(display,
-                    new OpenWorkbenchIntervalMonitor(meters));
-            meters.stop(OpenWorkbenchIntervalMonitor.finalInterval);
-
+            		new OpenWorkbenchIntervalMonitor(startupMeter, shutdownMeter));
+            shutdownMeter.stop();
             assertEquals(PlatformUI.RETURN_OK, code);
         }
 
         display.dispose();
         assertTrue(display.isDisposed());
-
-        meters.commit();
-        meters.assertPerformance();
-        meters.dispose();
+        startupMeter.commit();
+        perf.assertPerformance(startupMeter);
+        
+        // The shutdown timer is currently < 50ms on all test machine. Due to the granularity of timers
+        // and inherit Java variability, values below 100ms usually can not be interpreted.
+        // Rather, check for the absolute value to be below threshold of 120ms.
+        // If the test goes above it, it probably needs to be investigated.
+        perf.assertPerformanceInAbsoluteBand(shutdownMeter, Dimension.CPU_TIME, 0, 120);
+        
+    	startupMeter.dispose();
+    	shutdownMeter.dispose();
     }
 
     public void testRestore() {
         Display display = PlatformUI.createDisplay();
-
+        Performance perf = Performance.getDefault();
+        String baseScenarioId = perf.getDefaultScenarioId(this);
+        PerformanceMeter startupMeter = perf.createPerformanceMeter( baseScenarioId + " [open]"); 
+        PerformanceMeter shutdownMeter = perf.createPerformanceMeter( baseScenarioId + " [close]");
+        
         // create an advisor that will just start the workbench long enough to create
         // something to be restored later
-        WorkbenchAdvisor wa = new RestoreWorkbenchIntervalMonitor();
-
+        PerformanceMeter startupMeter0 = perf.createPerformanceMeter( baseScenarioId + " [0][open]"); 
+        PerformanceMeter shutdownMeter0 = perf.createPerformanceMeter( baseScenarioId + " [0][close]");
+        WorkbenchAdvisor wa = new RestoreWorkbenchIntervalMonitor(startupMeter0, shutdownMeter0, true);
         int code = PlatformUI.createAndRunWorkbench(display, wa);
         assertEquals(PlatformUI.RETURN_RESTART, code);
         assertFalse(display.isDisposed());
-
-        // the rest is a bunch of code to restore the workbench and monitor performance
-        // while doing so
-
-        Performance perf = Performance.getDefault();
-
-        String baseScenarioId = perf.getDefaultScenarioId(this);
-        IPerformanceMeterArray meters = new IntervalMeters(perf, baseScenarioId, RestoreWorkbenchIntervalMonitor.intervalNames);
-
+    	startupMeter0.dispose();
+    	shutdownMeter0.dispose();
+       
         tagAsSummary("Restore RCP App", Dimension.CPU_TIME);
         
+        // the rest is a bunch of code to restore the workbench and monitor performance
+        // while doing so
         for (int i = 0; i < REPEAT_COUNT; ++i ) {
-            meters.start(RestoreWorkbenchIntervalMonitor.firstInterval);
+        	startupMeter.start();
             code = PlatformUI.createAndRunWorkbench(display,
-                    new RestoreWorkbenchIntervalMonitor(meters));
-            meters.stop(RestoreWorkbenchIntervalMonitor.finalInterval);
-
+                    new RestoreWorkbenchIntervalMonitor(startupMeter, shutdownMeter, false));
+            shutdownMeter.stop();
             assertEquals(PlatformUI.RETURN_OK, code);
         }
-
-        meters.commit();
-        meters.assertPerformance();
-        meters.dispose();
-
+        
         display.dispose();
         assertTrue(display.isDisposed());
+        
+        startupMeter.commit();
+        perf.assertPerformance(startupMeter);
+        
+        // The shutdown timer is currently < 50ms on all test machine. Due to the granularity of timers
+        // and inherit Java variability, values below 100ms usually can not be interpreted.
+        // Rather, check for the absolute value to be below threshold of 120ms.
+        // If the test goes above it, it probably needs to be investigated.
+        perf.assertPerformanceInAbsoluteBand(shutdownMeter, Dimension.CPU_TIME, 0, 120);
+        
+    	startupMeter.dispose();
+    	shutdownMeter.dispose();
     }
 }
diff --git a/tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/IPerformanceMeterArray.java b/tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/IPerformanceMeterArray.java
deleted file mode 100644
index 2cf5d8b..0000000
--- a/tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/IPerformanceMeterArray.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.tests.rcp.util;
-
-/**
- * An array of performance meters that can be used for things like interval timing.
- * 
- * @since 3.1
- */
-public interface IPerformanceMeterArray {
-
-    /**
-     * Start the meter at the argument index.
-     */
-    public void start(int meterIndex);
-
-    /**
-     * Stop the meter at the argument index.
-     */
-    public void stop(int meterIndex);
-
-    /**
-     * Commit all meters in this array.
-     */
-    public void commit();
-
-    /**
-     * Assert the performance of all meters in this array.
-     */
-    public void assertPerformance();
-
-    /**
-     * Dispose all meters in this array.
-     */
-    public void dispose();
-}
diff --git a/tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/IntervalMeters.java b/tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/IntervalMeters.java
deleted file mode 100644
index 1c2317d..0000000
--- a/tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/IntervalMeters.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.tests.rcp.util;
-
-import org.eclipse.test.performance.Performance;
-import org.eclipse.test.performance.PerformanceMeter;
-
-/**
- * A set of meters that should be used to check performance of intervals.  For example, this
- * collection is used to check performance between all stages of the workbench life-cycle
- * (the significant events are marked in the WorkbenchAdvisor callbacks).
- * 
- * @since 3.1
- */
-public class IntervalMeters implements IPerformanceMeterArray {
-
-    private Performance perf;
-    private String baseScenarioId;
-
-    /**
-     * Clients instantiate the interval meter set as a specific size and are then responsible
-     * for controlling by index.
-     */
-    private PerformanceMeter[] meters;
-
-    /**
-     * Create an set of performance meters using the argument array of strings in the name
-     * for each one
-     * @param intervals
-     */
-    public IntervalMeters(Performance perf, String baseScenarioId, String[] intervals) {
-        this.perf = perf;
-        this.baseScenarioId = baseScenarioId;
-
-        meters = new PerformanceMeter[intervals.length];
-        for (int i = 0; i < intervals.length; ++i) {
-            meters[i] = perf.createPerformanceMeter(getScenarioId(intervals[i]));
-        }
-    }
-
-    private String getScenarioId(String intervalName) {
-        return baseScenarioId + " [" + intervalName + ']'; //$NON-NLS-1$
-    }
-
-    public void start(int meterIndex) {
-        meters[meterIndex].start();
-    }
-
-    public void stop(int meterIndex) {
-        meters[meterIndex].stop();
-    }
-
-    /**
-     * The interval at the argument has completed.  Stop that meter and start the next.
-     * @param completedIntervalIndex
-     */
-    public void intervalBoundary(int completedIntervalIndex) {
-        meters[completedIntervalIndex].stop();
-        meters[completedIntervalIndex + 1].start();
-    }
-
-    public void commit() {
-        for (int i = 0; i < meters.length; ++i)
-            meters[i].commit();
-    }
-
-    public void assertPerformance() {
-        for (int i = 0; i < meters.length; ++i)
-            perf.assertPerformance(meters[i]);
-    }
-
-    public void dispose() {
-        for (int i = 0; i < meters.length; ++i)
-            meters[i].dispose();
-    }
-}
diff --git a/tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/NullMeters.java b/tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/NullMeters.java
deleted file mode 100644
index 3dd21b0..0000000
--- a/tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/NullMeters.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.tests.rcp.util;
-
-/**
- * An empty array of meters, all calls are ignored.
- * 
- * @since 3.1
- */
-public class NullMeters implements IPerformanceMeterArray {
-
-    public NullMeters() {
-        // do nothing
-    }
-
-    public void start(int meterIndex) {
-        // do nothing
-    }
-
-    public void stop(int meterIndex) {
-        // do nothing
-    }
-
-    public void intervalBoundary(int completedIntervalIndex) {
-        // do nothing
-    }
-
-    public void commit() {
-        // do nothing
-    }
-
-    public void assertPerformance() {
-        // do nothing
-    }
-
-    public void dispose() {
-        // do nothing
-    }
-}
diff --git a/tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/OpenWorkbenchIntervalMonitor.java b/tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/OpenWorkbenchIntervalMonitor.java
index f3097de..af922e4 100644
--- a/tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/OpenWorkbenchIntervalMonitor.java
+++ b/tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/OpenWorkbenchIntervalMonitor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,11 +10,7 @@
  *******************************************************************************/
 package org.eclipse.ui.tests.rcp.util;
 
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.application.IActionBarConfigurer;
-import org.eclipse.ui.application.IWorkbenchConfigurer;
-import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
-
+import org.eclipse.test.performance.PerformanceMeter;
 
 /**
  * This implementation of the workbench advisor tracks performance for the intervals between
@@ -24,97 +20,24 @@
  */
 public class OpenWorkbenchIntervalMonitor extends RCPTestWorkbenchAdvisor {
 
-    public static final String[] intervalNames = new String[] {
-        "open", //$NON-NLS-1$
-        "close" //$NON-NLS-1$
-	};
-	
-	public static final int openInterval = 0;
-	public static final int closeInterval = 1;
-	
-	public static final int firstInterval = openInterval;
-	public static final int finalInterval = closeInterval;
+    private PerformanceMeter startupMeter; 
+    private PerformanceMeter shutdownMeter; 
 
-//    public static final String[] intervalNames = new String[] {
-//            "to initialize", //$NON-NLS-1$
-//            "initialize to preStartup", //$NON-NLS-1$
-//            "preStartup to preWindowOpen", //$NON-NLS-1$
-//            "preWindowOpen to fillActionBars", //$NON-NLS-1$
-//            "fillActionBars to postWindowOpen", //$NON-NLS-1$
-//            "postWindowOpen to postStartup", //$NON-NLS-1$
-//            "preShutdown to postShutdown", //$NON-NLS-1$
-//            "postShutdown to complete" //$NON-NLS-1$
-//    };
-//
-//    public static final int initializeInterval = 0;
-//    public static final int preStartupInterval = 1;
-//    public static final int preWindowOpenInterval = 2;
-//    public static final int fillActionBarsInterval = 3;
-//    public static final int postWindowOpenInterval = 4;
-//    public static final int postStartupInterval = 5;
-//    public static final int shutdownInterval = 6;
-//    public static final int workbenchDestroyedInterval = 7;
-//
-//    public static final int firstInterval = initializeInterval;
-//    public static final int finalInterval = workbenchDestroyedInterval;
-
-    private IPerformanceMeterArray meters;
-
-    public OpenWorkbenchIntervalMonitor(IPerformanceMeterArray meters) {
+    public OpenWorkbenchIntervalMonitor(PerformanceMeter startupMeter, PerformanceMeter shutdownMeter) {
         super(2);
-        this.meters = meters;
-    }
-
-    public void initialize(IWorkbenchConfigurer configurer) {
-//        meters.stop(initializeInterval);
-//        meters.start(preStartupInterval);
-        super.initialize(configurer);
-    }
-
-    public void preStartup() {
-//        meters.stop(preStartupInterval);
-//        meters.start(preWindowOpenInterval);
-        super.preStartup();
-    }
-
-    public void preWindowOpen(IWorkbenchWindowConfigurer configurer) {
-//        meters.stop(preWindowOpenInterval);
-//        meters.start(fillActionBarsInterval);
-        super.preWindowOpen(configurer);
-    }
-
-    public void fillActionBars(IWorkbenchWindow window, IActionBarConfigurer configurer, int flags) {
-//        meters.stop(fillActionBarsInterval);
-//        meters.start(postWindowOpenInterval);
-        super.fillActionBars(window, configurer, flags);
-
-    }
-
-    public void postWindowOpen(IWorkbenchWindowConfigurer configurer) {
-//        meters.stop(postWindowOpenInterval);
-//        meters.start(postStartupInterval);
-        super.postWindowOpen(configurer);
+        this.startupMeter = startupMeter;
+        this.shutdownMeter = shutdownMeter;
     }
 
     public void postStartup() {
-//        meters.stop(postStartupInterval);
-    	meters.stop(openInterval);
-    	
-        // no reason to track performace between when startup completes and shutdown starts
+    	startupMeter.stop();
+        // no reason to track performance between when startup completes and shutdown starts
         // since that is just testing overhead
-
         super.postStartup();
     }
 
     public boolean preShutdown() {
-//        meters.start(shutdownInterval);
-    	meters.start(closeInterval);
+    	shutdownMeter.start();
         return super.preShutdown();
     }
-
-    public void postShutdown() {
-//        meters.stop(shutdownInterval);
-//        meters.start(workbenchDestroyedInterval);
-        super.postShutdown();
-    }
 }
diff --git a/tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/RestoreWorkbenchIntervalMonitor.java b/tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/RestoreWorkbenchIntervalMonitor.java
index b8e4e8a..2130cf2 100644
--- a/tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/RestoreWorkbenchIntervalMonitor.java
+++ b/tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/RestoreWorkbenchIntervalMonitor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,12 +11,8 @@
 package org.eclipse.ui.tests.rcp.util;
 
 import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.WorkbenchException;
-import org.eclipse.ui.application.IActionBarConfigurer;
+import org.eclipse.test.performance.PerformanceMeter;
 import org.eclipse.ui.application.IWorkbenchConfigurer;
-import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
-
 
 /**
  * This implementation of the workbench advisor tracks performance for the intervals between
@@ -26,128 +22,44 @@
  */
 public class RestoreWorkbenchIntervalMonitor extends RCPTestWorkbenchAdvisor {
 
-    public static final String[] intervalNames = new String[] {
-        "open", //$NON-NLS-1$
-        "close" //$NON-NLS-1$
-	};
-	
-	public static final int openInterval = 0;
-	public static final int closeInterval = 1;
-	
-	public static final int firstInterval = openInterval;
-	public static final int finalInterval = closeInterval;
+    private PerformanceMeter startupMeter; 
+    private PerformanceMeter shutdownMeter; 
 	
 	private boolean createRestorableWorkbench = false;
-	private IPerformanceMeterArray meters = new NullMeters();
 	
-//    public static final String[] intervalNames = new String[] {
-//            "to initialize", //$NON-NLS-1$
-//            "initialize to preStartup", //$NON-NLS-1$
-//            "preStartup to preWindowOpen", //$NON-NLS-1$
-//            "preWindowOpen to fillActionBars", //$NON-NLS-1$
-//            "fillActionBars to postWindowRestore", //$NON-NLS-1$
-//            "postWindowRestore to postWindowOpen", //$NON-NLS-1$
-//            "postWindowOpen to postStartup", //$NON-NLS-1$
-//            "preShutdown to postShutdown", //$NON-NLS-1$
-//            "postShutdown to complete" //$NON-NLS-1$
-//    };
-//
-//    public static final int initializeInterval = 0;
-//    public static final int preStartupInterval = 1;
-//    public static final int preWindowOpenInterval = 2;
-//    public static final int fillActionBarsInterval = 3;
-//    public static final int postWindowRestoreInterval = 4;
-//    public static final int postWindowOpenInterval = 5;
-//    public static final int postStartupInterval = 6;
-//    public static final int shutdownInterval = 7;
-//    public static final int workbenchDestroyedInterval = 8;
-//
-//    public static final int firstInterval = initializeInterval;
-//    public static final int finalInterval = workbenchDestroyedInterval;
-//
-//    private boolean createRestorableWorkbench = false;
-//    private IPerformanceMeterArray meters = new NullMeters();
-
     private IWorkbenchConfigurer workbenchConfigurer;
 
     /**
-     * The default behaviour is to create a workbench that can be restored later.  This
-     * constructor starts that behaviour by setting a flag that will be checked in the
+     * The default behavior is to create a workbench that can be restored later.  This
+     * constructor starts that behavior by setting a flag that will be checked in the
      * appropriate methods.
      */
-    public RestoreWorkbenchIntervalMonitor() {
+    public RestoreWorkbenchIntervalMonitor(PerformanceMeter startupMeter, PerformanceMeter shutdownMeter, boolean createRestorableWorkbench) {
         super(2);
-        createRestorableWorkbench = true;
-    }
-
-    public RestoreWorkbenchIntervalMonitor(IPerformanceMeterArray meters) {
-        super(2);
-        this.meters = meters;
+        this.startupMeter = startupMeter;
+        this.shutdownMeter = shutdownMeter;
+        this.createRestorableWorkbench = createRestorableWorkbench;
     }
 
     public void initialize(IWorkbenchConfigurer configurer) {
-//        meters.stop(initializeInterval);
-
         super.initialize(configurer);
         workbenchConfigurer = configurer;
         workbenchConfigurer.setSaveAndRestore(true);
-
-//        meters.start(preStartupInterval);
-    }
-
-    public void preStartup() {
-//        meters.stop(preStartupInterval);
-        super.preStartup();
-//        meters.start(preWindowOpenInterval);
-    }
-
-    public void preWindowOpen(IWorkbenchWindowConfigurer configurer) {
-//        meters.stop(preWindowOpenInterval);
-        super.preWindowOpen(configurer);
-//        meters.start(fillActionBarsInterval);
-    }
-
-    public void fillActionBars(IWorkbenchWindow window, IActionBarConfigurer configurer, int flags) {
-//        meters.stop(fillActionBarsInterval);
-        super.fillActionBars(window, configurer, flags);
-//        meters.start(postWindowRestoreInterval);
-    }
-
-    public void postWindowRestore(IWorkbenchWindowConfigurer configurer) throws WorkbenchException {
-//        meters.stop(postWindowRestoreInterval);
-        super.postWindowRestore(configurer);
-//        meters.start(postWindowOpenInterval);
-    }
-
-    public void postWindowOpen(IWorkbenchWindowConfigurer configurer) {
-//        meters.stop(postWindowOpenInterval);
-        super.postWindowOpen(configurer);
-//        meters.start(postStartupInterval);
     }
 
     public void postStartup() {
-//        meters.stop(postStartupInterval);
-        meters.stop(openInterval);
-
-        // no reason to track performace between when startup completes and shutdown starts
+    	startupMeter.stop();
+        // no reason to track performance between when startup completes and shutdown starts
         // since that is just testing overhead
-
         super.postStartup();
     }
 
     public boolean preShutdown() {
         boolean ret = super.preShutdown();
-//        meters.start(shutdownInterval);
-        meters.start(closeInterval);
+        shutdownMeter.start();
         return ret;
     }
 
-    public void postShutdown() {
-//        meters.stop(shutdownInterval);
-        super.postShutdown();
-//        meters.start(workbenchDestroyedInterval);
-    }
-
     public void eventLoopIdle(Display d) {
         if (createRestorableWorkbench)
             workbenchConfigurer.getWorkbench().restart();