Bug 678178 - Update endurance shared module to reflect rename of micro-iterations to entities. r=ahughes r=hskupin mozilla-release
authorDave Hunt <dhunt@mozilla.com>
Wed, 17 Aug 2011 12:01:38 +0100
branchmozilla-release
changeset 1508 d3aa6104d3e5
parent 1500 0a6a1b8b23ba
child 1513 6ee1c2820ee3
push id1379
push userdhunt@mozilla.com
push date2011-08-17 11:02 +0000
reviewersahughes, hskupin
bugs678178
Bug 678178 - Update endurance shared module to reflect rename of micro-iterations to entities. r=ahughes r=hskupin
lib/endurance.js
--- a/lib/endurance.js
+++ b/lib/endurance.js
@@ -48,26 +48,26 @@ Components.utils.import('resource://mozm
  * 
  * @param {MozMillController} controller
  *        MozMillController of the window to operate on
  */
 function EnduranceManager(controller) {
   this._controller = controller;
   this._perfTracer = new performance.PerfTracer("Endurance");
   this._currentIteration = 1;
-  this._currentMicroIteration = 1;
+  this._currentEntity = 1;
   if ("endurance" in persisted) {
     this._delay = persisted.endurance.delay;
     this._iterations = persisted.endurance.iterations;
-    this._microIterations = persisted.endurance.micro_iterations;
+    this._entities = persisted.endurance.entities;
   } else {
     // Running the endurance test directly so set default values
     this._delay = 100;
     this._iterations = 1;
-    this._microIterations = 1;
+    this._entities = 1;
   }
 
   frame.events.fireEvent('installedAddons',
     addons.getInstalledAddons(function (addon) {
       return {
         id : addon.id,
         type : addon.type,
         name : addon.name,
@@ -80,22 +80,22 @@ function EnduranceManager(controller) {
 }
 
 /**
  * Endurance class
  */
 EnduranceManager.prototype = {
 
   /**
-   * Get the number of micro-iterations
+   * Get the number of entities
    *
-   * @returns {Number} Number of micro-iterations
+   * @returns {Number} Number of entities
    */
-  get microIterations() {
-    return this._microIterations;
+  get entities() {
+    return this._entities;
   },
 
   /**
    * Run endurance test
    *
    * @param {function} callback
    *        Callback function to call
    */
@@ -117,37 +117,37 @@ EnduranceManager.prototype = {
       this._perfTracer.addCheckpoint("End iteration");
       _testResults.iterations.push({"checkpoints" : this._perfTracer._log});
       this._perfTracer.clearLog();
     }
     frame.events.fireEvent('enduranceResults', _testResults)
   },
 
   /**
-   * Loop (micro-iteration)
+   * Loop through each of the entities
    *
    * @param {function} callback
    *        Callback function to call
    */
   loop : function endurance_loop(callback) {
-    for (var i = 0; i < this._microIterations; i++) {
-      this._currentMicroIteration = i + 1;
+    for (var i = 0; i < this._entities; i++) {
+      this._currentEntity = i + 1;
       this._controller.sleep(this._delay);
       callback();
     }
   },
 
   /**
    * Add a checkpoint.
    *
    * @param {string} label
    *        Label for checkpoint
    */
   addCheckpoint : function endurance_addCheckpoint(label) {
     this._perfTracer.addCheckpoint(label +
                                    " [i:" + this._currentIteration +
-                                   " mi:" + this._currentMicroIteration + "]");
+                                   " e:" + this._currentEntity + "]");
   }
 
 }
 
 // Export of classes
 exports.EnduranceManager = EnduranceManager;