Module: check_mk
Branch: master
Commit: b838f88290ad5b9e33950f6954becd9516aa27de
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b838f88290ad5b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Sep 27 08:43:43 2012 +0200
Added "profile" option to be configurable via browser
---
ChangeLog | 1 +
web/plugins/wato/check_mk_configuration.py | 17 ++++++++++++++++-
2 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 70846eb..2c6144b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,7 @@
aggregation compilations
WATO
+ * Added "profile" option to be configurable via browser
* FIX: It is now possible to create clusters in empty folders
* FIX: Fixed problem with complaining empty ListOf() valuespecs
diff --git a/web/plugins/wato/check_mk_configuration.py b/web/plugins/wato/check_mk_configuration.py
index 0f8cd83..f89d887 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -52,6 +52,21 @@ register_configvar(group,
domain = "multisite")
register_configvar(group,
+ "profile",
+ Checkbox(
+ title = _("Profile requests"),
+ label = _("enable profile mode"),
+ help = _("It is possible to profile the rendering process of Multisite pages. This "
+ "Is done using the Python module cProfile. When enabled two files are placed "
+ "into the Multisite var directory named <code>multisite.profile</code> and "
+ "<code>multisite.profile.py</code>. By executing the later file you can get "
+ "runtime statistics about the last processed page."),
+ default_value = False
+ ),
+ domain = "multisite"
+)
+
+register_configvar(group,
"debug_livestatus_queries",
Checkbox(title = _("Debug Livestatus queries"),
label = _("enable debug of Livestatus queries"),
@@ -237,7 +252,7 @@ register_configvar(group,
Optional(
Filename(
label = _("Absolute path to log file"),
- default = defaults.var_dir + '/bi-compile.log',
+ default = defaults.var_dir + '/web/bi-compile.log',
),
title = _("Logfile for BI compilation diagnostics"),
label = _("Activate logging of BI compilations into a logfile"),
Module: check_mk
Branch: master
Commit: 800273c90235068e30db3f85e1bebb8bc9e93f00
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=800273c9023506…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Sep 27 10:03:56 2012 +0200
Some small performance improvement
---
web/htdocs/htmllib.py | 15 +++++----------
1 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index 69257fa..9805478 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -87,25 +87,20 @@ def attrencode(value):
# is saving more then 90% of the total HTML generating time
# on more complex pages!
def urlencode_vars(vars):
- output = ""
+ output = []
for varname, value in vars:
- if output != "":
- output += "&"
-
if type(value) == int:
value = str(value)
elif type(value) == unicode:
value = value.encode("utf-8")
- output += varname
- output += "="
try:
# urllib is not able to encode non-Ascii characters. Yurks
- output += urllib.quote(value)
+ output.append(varname + '=' + urllib.quote(value))
except:
- output += urlencode(value) # slow but working
+ output.append(varname + '=' + urlencode(value)) # slow but working
- return output
+ return '&'.join(output)
def urlencode(value):
if type(value) == unicode:
@@ -332,7 +327,7 @@ class html:
# [('varname1', value1), ('varname2', value2) ]
def makeuri(self, addvars, remove_prefix = None):
- vars = [ (v, self.var(v)) for v in self.req.vars if not v.startswith("_") ]
+ vars = [ (v, self.var(v)) for v in self.req.vars if v[0] != "_" ]
if remove_prefix != None:
vars = [ i for i in vars if not i[0].startswith(remove_prefix) ]
return self.req.myfile + ".py?" + urlencode_vars(vars + addvars)