summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlya Mashchenko <ilya@netdata.cloud>2023-10-16 12:38:39 +0300
committerGitHub <noreply@github.com>2023-10-16 12:38:39 +0300
commit145aad2703ff6de8363b6b38774dfa7337bb8bfb (patch)
treef39a4f9cb41f795a6458cf98d913e317a19098d7
parentbadb0175796f540f89ae6852918be7296d420ab7 (diff)
apps: fix divide by zero when calc avg uptime (#16211)
-rw-r--r--collectors/apps.plugin/apps_plugin.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/collectors/apps.plugin/apps_plugin.c b/collectors/apps.plugin/apps_plugin.c
index bd204afc60..152038968b 100644
--- a/collectors/apps.plugin/apps_plugin.c
+++ b/collectors/apps.plugin/apps_plugin.c
@@ -3813,7 +3813,7 @@ static void send_collected_data_to_netdata(struct target *root, const char *type
if (enable_detailed_uptime_charts) {
send_BEGIN(type, w->clean_name, "uptime_summary", dt);
send_SET("min", w->uptime_min);
- send_SET("avg", w->uptime_sum / w->processes);
+ send_SET("avg", w->processes > 0 ? w->uptime_sum / w->processes : 0);
send_SET("max", w->uptime_max);
send_END();
}