private function sumField($devices = null, $partitions = null, $field) {
        $result = 0;

        if ($devices) {
            $devices = (array) $devices;
        }

        if (is_array($devices)) {
            $devices = array_flip($devices);
        }

        if ($partitions) {
            $partitions = (array) $partitions;
        }

        if (is_array($partitions)) {
            $partitions = array_flip($partitions);
        }

        foreach ($this->devices as $device => $partition) {
            if ($devices && !isset($devices[$device])) {
                continue;
            }

            foreach ($partition as $p => $info) {
                if ($partitions && !isset($partitions[$p])) {
                    continue;
                }

                $result += $info[$field];
            }
        }

        return $result;
    }