function getField(data, path) {
	var steps = path.split('.');
	for (var i = 0; i < steps.length; i++) {
		var step = steps[i];
		if (typeof data !== 'object' || typeof data[step] === 'undefined') {
			throw 'Required field was not found: ' + path;
		}

		data = data[step];
	}

	return data;
}

var data = JSON.parse(value),
	php_total = getField(data,'ocs.data.server.php.memory_limit'),
	php_free = getField(data,'ocs.data.server.php.opcache.memory_usage.used_memory');

return Math.ceil(php_free / php_total * 100);