mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-19 10:23:03 +00:00
Made minor changes to improve the accuracy of cpu utilization metric Signed-off-by: Nagendrababu <nagendrababu.bonkuri@connectus.ai>
14 lines
582 B
Diff
14 lines
582 B
Diff
Index: opensync-2.0.5.0/src/lib/target/src/target_linux.c
|
|
===================================================================
|
|
--- opensync-2.0.5.0.orig/src/lib/target/src/target_linux.c
|
|
+++ opensync-2.0.5.0/src/lib/target/src/target_linux.c
|
|
@@ -249,7 +249,7 @@ static bool linux_device_cpuutil_get(dpp
|
|
}
|
|
|
|
/* Calculate percentage and round */
|
|
- busy = (1.0 - ((double)diff.hz_idle / (double)hz_total_diff)) * 100.0;
|
|
+ busy = (100.0 - (((double)diff.hz_idle *100.0) / (double)hz_total_diff));
|
|
|
|
cpuutil->cpu_util = (uint32_t) (busy + 0.5);
|
|
|