var data = JSON.parse(value),
	replicas,
	replicas_ready;

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_statefulset_status_replicas') {
		replicas = item.value;
	}
	if (item.name === 'kube_statefulset_status_replicas_ready') {
		replicas_ready = item.value;
	}
});

return Math.abs(replicas - replicas_ready);