model/consoleState.js
function(memory) {
        var memoryHistory = this.get('memory');

        if (!memoryHistory) {
            memoryHistory = [];
            this.set({
                memory: memoryHistory
            });
        }

        memoryHistory.push(memory);
        while (memoryHistory.length > this._statHistory) {
            memoryHistory.shift();
        }

        var avg = 0;
        memoryHistory.filter(function(f) {
            return f !== null;
        }).forEach(function(f) {
            avg += f;
        });
        avg /= memoryHistory.length;
        this.set({
            avgMemory: Math.round(avg)
        });
    }
function(memory) {
        var memoryHistory = this.get('memory');

        if (!memoryHistory) {
            memoryHistory = [];
            this.set({
                memory: memoryHistory
            });
        }

        memoryHistory.push(memory);
        while (memoryHistory.length > this._statHistory) {
            memoryHistory.shift();
        }

        var avg = 0;
        memoryHistory.filter(function(f) {
            return f !== null;
        }).forEach(function(f) {
            avg += f;
        });
        avg /= memoryHistory.length;
        this.set({
            avgMemory: Math.round(avg)
        });
    }
function ( memory ) { var memoryHistory = this . get ( 'memory' ) ; if ( ! memoryHistory ) { memoryHistory = [ ] ; this . set ( { memory : memoryHistory } ) ; } memoryHistory . push ( memory ) ; while ( memoryHistory . length > this . _statHistory ) { memoryHistory . shift ( ) ; } var avg = 0 ; memoryHistory . filter ( function ( f ) { return f !== null ; } ) . forEach ( function ( f ) { avg += f ; } ) ; avg /= memoryHistory . length ; this . set ( { avgMemory : Math . round ( avg ) } ) ; }
Add a memory usage sample to the history.
Add a memory usage sample to the history .