lib/third_party/tracing/model/counter.js
function() {
      this.totals = [];
      this.maxTotal = 0;
      this.bounds.reset();

      if (this.series_.length === 0)
        return;

      var firstSeries = this.series_[0];
      var lastSeries = this.series_[this.series_.length - 1];

      this.bounds.addValue(firstSeries.getTimestamp(0));
      this.bounds.addValue(lastSeries.getTimestamp(lastSeries.length - 1));

      var numSeries = this.numSeries;
      this.maxTotal = -Infinity;

      // Sum the samples at each timestamp.
      // Note, this assumes that all series have all timestamps.
      for (var i = 0; i < firstSeries.length; ++i) {
        var total = 0;
        this.series_.forEach(function(series) {
          total += series.getSample(i).value;
          this.totals.push(total);
        }.bind(this));

        this.maxTotal = Math.max(total, this.maxTotal);
      }
    }
function() {
      this.totals = [];
      this.maxTotal = 0;
      this.bounds.reset();

      if (this.series_.length === 0)
        return;

      var firstSeries = this.series_[0];
      var lastSeries = this.series_[this.series_.length - 1];

      this.bounds.addValue(firstSeries.getTimestamp(0));
      this.bounds.addValue(lastSeries.getTimestamp(lastSeries.length - 1));

      var numSeries = this.numSeries;
      this.maxTotal = -Infinity;

      // Sum the samples at each timestamp.
      // Note, this assumes that all series have all timestamps.
      for (var i = 0; i < firstSeries.length; ++i) {
        var total = 0;
        this.series_.forEach(function(series) {
          total += series.getSample(i).value;
          this.totals.push(total);
        }.bind(this));

        this.maxTotal = Math.max(total, this.maxTotal);
      }
    }
function ( ) { this . totals = [ ] ; this . maxTotal = 0 ; this . bounds . reset ( ) ; if ( this . series_ . length === 0 ) return ; var firstSeries = this . series_ [ 0 ] ; var lastSeries = this . series_ [ this . series_ . length - 1 ] ; this . bounds . addValue ( firstSeries . getTimestamp ( 0 ) ) ; this . bounds . addValue ( lastSeries . getTimestamp ( lastSeries . length - 1 ) ) ; var numSeries = this . numSeries ; this . maxTotal = - Infinity ; // Sum the samples at each timestamp. // Note, this assumes that all series have all timestamps. for ( var i = 0 ; i < firstSeries . length ; ++ i ) { var total = 0 ; this . series_ . forEach ( function ( series ) { total += series . getSample ( i ) . value ; this . totals . push ( total ) ; } . bind ( this ) ) ; this . maxTotal = Math . max ( total , this . maxTotal ) ; } }
Updates the bounds for this counter based on the samples it contains.
Updates the bounds for this counter based on the samples it contains .