Gauge/ProcessesGauge.php
protected function aggregateCpu($processes)
    {
        $cpus = array();

        foreach ($processes as $process) {
            if (isset($cpus[$process->getName()])) {
                $cpus[$process->getName()] += $process->getCpu();
            }
            else {
                $cpus[$process->getName()] = $process->getCpu();
            }
        }

        return $cpus;
    }
protected function aggregateCpu($processes)
    {
        $cpus = array();

        foreach ($processes as $process) {
            if (isset($cpus[$process->getName()])) {
                $cpus[$process->getName()] += $process->getCpu();
            }
            else {
                $cpus[$process->getName()] = $process->getCpu();
            }
        }

        return $cpus;
    }
protected function aggregateCpu ( $ processes ) { $ cpus = array ( ) ; foreach ( $ processes as $ process ) { if ( isset ( $ cpus [ $ process -> getName ( ) ] ) ) { $ cpus [ $ process -> getName ( ) ] += $ process -> getCpu ( ) ; } else { $ cpus [ $ process -> getName ( ) ] = $ process -> getCpu ( ) ; } } return $ cpus ; }
Aggregate CPU for processes with the same name

@param $processes Process[]
Aggregate CPU for processes with the same name