[icinga-checkins] icinga.org: icinga-core/r1.2: classic ui: fix waste of cpu in status summary (TomTom) #933
git at icinga.org
git at icinga.org
Tue Nov 9 08:24:13 CET 2010
Module: icinga-core
Branch: r1.2
Commit: d35821a1ae2cca1f3dfe972f3112857caf722b66
URL: https://git.icinga.org/?p=icinga-core.git;a=commit;h=d35821a1ae2cca1f3dfe972f3112857caf722b66
Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date: Tue Nov 2 15:46:27 2010 +0100
classic ui: fix waste of cpu in status summary (TomTom) #933
From: Sven Nierlein <sven at consol.de>
"the servicegroup summary calculation has been corrected, but
unfortunately a useless loop over all services for every host
has been left over. This leads to very long loading page times.
The Servicegroup summary for all groups took around 8 seconds
but the summary for a single group took over 8 minutes.
The patch is sponsored by TomTom, so if you want to give kudos
to someone, then TomTom are the ones you are looking for."
-- check THANKS
fixes #933
---
Changelog | 1 +
THANKS | 1 +
cgi/status.c | 9 ++-------
3 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/Changelog b/Changelog
index 671afe6..8c39ff9 100644
--- a/Changelog
+++ b/Changelog
@@ -13,6 +13,7 @@ FIXES
* core: force my_free() macro users to end the statement with a semi-colon (Andreas Ericsson) #927
* classic ui: change servicestatus letter color to default black, not grey #946
+* classic ui: fix waste of cpu in status summary (TomTom) #933
* install: fix LD_LIBRARY_PATH export on non bash in idoutils init script #936
diff --git a/THANKS b/THANKS
index f0ca0a7..ad648f3 100644
--- a/THANKS
+++ b/THANKS
@@ -285,6 +285,7 @@ in various ways. If we missed your name, let us know.
* Robert Thompson
* Josh Thorstad
* David Tilloy
+* TomTom
* Gennaro Tortone
* Steve Traylen
* Steve Underwood
diff --git a/cgi/status.c b/cgi/status.c
index c6eeb49..346e902 100644
--- a/cgi/status.c
+++ b/cgi/status.c
@@ -1042,13 +1042,8 @@ void show_host_status_totals(void){
if(show_all_servicegroups==TRUE) {
count_host=1;
- } else {
- for(temp_servicestatus=servicestatus_list;temp_servicestatus!=NULL;temp_servicestatus=temp_servicestatus->next){
- if(is_host_member_of_servicegroup(find_servicegroup(servicegroup_name),temp_host)==TRUE){
- count_host=1;
- break;
- }
- }
+ } else if(is_host_member_of_servicegroup(find_servicegroup(servicegroup_name),temp_host)==TRUE){
+ count_host=1;
}
}
else if(display_type==DISPLAY_HOSTGROUPS && (show_all_hostgroups==TRUE || (is_host_member_of_hostgroup(find_hostgroup(hostgroup_name),temp_host)==TRUE)))
More information about the icinga-checkins
mailing list