If there is no requests, NAN is reported as hitratio.
If there is no hits - zero is reported.
*prev_part = part;
*prev_total = total;
- if (num == 0 || denom == 0)
+ if (denom == 0)
return NAN;
+ if (num == 0)
+ return 0;
+
return 100.0 * (gauge_t)num / (gauge_t)denom;
}
*prev1 = part1;
*prev2 = part2;
- if (num == 0 || denom == 0)
+ if (denom == 0)
return NAN;
+ if (num == 0)
+ return 0;
+
return 100.0 * (gauge_t)num / (gauge_t)denom;
}