function calculateStatsBalance (stats, weight, total) {
  return round(
    ((((stats.request * 100 / total) * weight.success) +
    ((stats.error * 100 / total) * weight.error)) +
    (stats.latency * weight.latency)) / 100)