B2G/gecko/services/metrics/dataprovider.jsm
/**
   * Aggregate another MetricsCollectionResult into this one.
   *
   * Instances can only be aggregated together if they belong to the same
   * provider (they have the same name).
   */
Aggregate another MetricsCollectionResult into this one.
Instances can only be aggregated together if they belong to the same
provider (they have the same name).
Aggregate another MetricsCollectionResult into this one . Instances can only be aggregated together if they belong to the same provider ( they have the same name ) .
function aggregate(other) {
    if (!(other instanceof MetricsCollectionResult)) {
      throw new Error("aggregate expects a MetricsCollectionResult instance.");
    }
    if (this.name != other.name) {
      throw new Error("Can only aggregate MetricsCollectionResult from " +
                      "the same provider. " + this.name + " != " + other.name);
    }
    for (let name of other.expectedMeasurements) {
      this.expectedMeasurements.add(name);
    }
    for (let [name, m] of other.measurements) {
      if (this.measurements.has(name)) {
        throw new Error("Incoming result has same measurement as us: " + name);
      }
      this.measurements.set(name, m);
    }
    this.errors = this.errors.concat(other.errors);
  }
function aggregate ( other ) { if ( ! ( other instanceof MetricsCollectionResult ) ) { throw new Error ( "aggregate expects a MetricsCollectionResult instance." ) ; } if ( this . name != other . name ) { throw new Error ( "Can only aggregate MetricsCollectionResult from " + "the same provider. " + this . name + " != " + other . name ) ; } for ( let name of other . expectedMeasurements ) { this . expectedMeasurements . add ( name ) ; } for ( let [ name , m ] of other . measurements ) { if ( this . measurements . has ( name ) ) { throw new Error ( "Incoming result has same measurement as us: " + name ) ; } this . measurements . set ( name , m ) ; } this . errors = this . errors . concat ( other . errors ) ; }
Aggregate another MetricsCollectionResult into this one.
Aggregate another MetricsCollectionResult into this one .