Module: check_mk
Branch: master
Commit: 77504e39d856c558a98a01c55ef4f7f9090a215c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=77504e39d856c5…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Mar 3 15:55:36 2016 +0100
BI host fetching livestatus query is now using liveproxyd cache
---
web/htdocs/bi.py | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/web/htdocs/bi.py b/web/htdocs/bi.py
index 29c7f02..019f7b9 100644
--- a/web/htdocs/bi.py
+++ b/web/htdocs/bi.py
@@ -121,11 +121,6 @@ def load_services(cache, only_hosts):
g_services = {}
g_services_by_hostname = {}
- # TODO: At the moment the data is always refetched. This could really
- # be optimized. Maybe create a cache which fetches data for the given
- # list of hosts, puts it to a cache and then only fetch the additionally
- # needed information which are not cached yet in future requests
-
# Create optional host filter
filter_txt = 'Filter: custom_variable_names < _REALNAME\n' # drop summary
hosts
if only_hosts:
@@ -138,9 +133,12 @@ def load_services(cache, only_hosts):
sites.live().set_prepend_site(True)
sites.live().set_auth_domain('bi')
- data = sites.live().query("GET hosts\n"
- +filter_txt+
- "Columns: name custom_variable_names
custom_variable_values services childs parents\n")
+ data = sites.live().query(
+ "GET hosts\n"
+ +filter_txt+
+ "Columns: name custom_variable_names custom_variable_values services childs
parents\n"
+ "Cache: reload\n"
+ )
sites.live().set_prepend_site(False)
sites.live().set_auth_domain('read')