var data = JSON.parse(value),
	replicas_desired,
	replicas_available;

if (data.length !== 2) {
	throw 'Incorrect length of JSON (must be 2). Actual length: ' + data.length;
}

JSON.parse(value).forEach(function (item) {
	if (item.name === 'kube_deployment_spec_replicas') {
		replicas_desired = item.value;
	}
	if (item.name === 'kube_deployment_status_replicas_available') {
		replicas_available = item.value;
	}
});

return Math.abs(replicas_desired - replicas_available);