MCPcopy Create free account
hub / github.com/F-Stack/f-stack / check_avg

Function check_avg

dpdk/app/test/test_red.c:254–269  ·  view source on GitHub ↗

* check if average queue size is within tolerance */

Source from the content-addressed store, hash-verified

252 * check if average queue size is within tolerance
253 */
254static int check_avg(double *diff, double avg, double exp_avg, double tolerance)
255{
256 double abs_diff = 0.0;
257 int ret = 1;
258
259 abs_diff = fabs(avg - exp_avg);
260 if ((int)abs_diff == 0) {
261 *diff = 0.0;
262 } else {
263 *diff = (abs_diff / exp_avg) * 100.0;
264 if (*diff > tolerance) {
265 ret = 0;
266 }
267 }
268 return ret;
269}
270
271/**
272 * initialize the test rte_red config

Callers 4

func_test3Function · 0.85
func_test4Function · 0.85
func_test6Function · 0.85
perf2_testFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected