profiling: default is now 'none' and config option will be checked instantly
This commit is contained in:
@@ -1696,9 +1696,10 @@ _(>= 3.5.10)_
|
|||||||
|
|
||||||
Log profiling data on level=info
|
Log profiling data on level=info
|
||||||
|
|
||||||
Default: `per_request`
|
Default: `none`
|
||||||
|
|
||||||
One of
|
One of
|
||||||
|
* `none` (disabled)
|
||||||
* `per_request` (above minimum duration)
|
* `per_request` (above minimum duration)
|
||||||
* `per_request_method` (regular interval)
|
* `per_request_method` (regular interval)
|
||||||
|
|
||||||
|
|||||||
4
config
4
config
@@ -322,8 +322,8 @@
|
|||||||
#storage_cache_actions_on_debug = False
|
#storage_cache_actions_on_debug = False
|
||||||
|
|
||||||
# Log profiling data on level=info
|
# Log profiling data on level=info
|
||||||
# Value: per_request | per_request_method
|
# Value: per_request | per_request_method | none
|
||||||
#profiling = per_request_method
|
#profiling = none
|
||||||
|
|
||||||
# Log profiling data per request minium duration (seconds)
|
# Log profiling data per request minium duration (seconds)
|
||||||
#profiling_per_request_min_duration = 3
|
#profiling_per_request_min_duration = 3
|
||||||
|
|||||||
@@ -41,12 +41,12 @@ from radicale import auth, hook, rights, storage, types, web
|
|||||||
from radicale.hook import email
|
from radicale.hook import email
|
||||||
from radicale.item import check_and_sanitize_props
|
from radicale.item import check_and_sanitize_props
|
||||||
|
|
||||||
from radicale import app # isort:skip (circular import issue)
|
|
||||||
|
|
||||||
DEFAULT_CONFIG_PATH: str = os.pathsep.join([
|
DEFAULT_CONFIG_PATH: str = os.pathsep.join([
|
||||||
"?/etc/radicale/config",
|
"?/etc/radicale/config",
|
||||||
"?~/.config/radicale/config"])
|
"?~/.config/radicale/config"])
|
||||||
|
|
||||||
|
PROFILING: Sequence[str] = ("per_request", "per_request_method", "none")
|
||||||
|
|
||||||
|
|
||||||
def positive_int(value: Any) -> int:
|
def positive_int(value: Any) -> int:
|
||||||
value = int(value)
|
value = int(value)
|
||||||
@@ -72,6 +72,12 @@ def logging_level(value: Any) -> str:
|
|||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
||||||
|
def profiling(value: Any) -> str:
|
||||||
|
if value not in PROFILING:
|
||||||
|
raise ValueError("unsupported profiling: %r" % value)
|
||||||
|
return value
|
||||||
|
|
||||||
|
|
||||||
def filepath(value: Any) -> str:
|
def filepath(value: Any) -> str:
|
||||||
if not value:
|
if not value:
|
||||||
return ""
|
return ""
|
||||||
@@ -584,10 +590,9 @@ This is an automated message. Please do not reply.""",
|
|||||||
"help": "log storage cache action on level=debug",
|
"help": "log storage cache action on level=debug",
|
||||||
"type": bool}),
|
"type": bool}),
|
||||||
("profiling", {
|
("profiling", {
|
||||||
"value": "per_request_method",
|
"value": "none",
|
||||||
"help": "log profiling data level=info",
|
"help": "log profiling data level=info",
|
||||||
"type": str,
|
"type": profiling}),
|
||||||
"internal": app.PROFILING}),
|
|
||||||
("profiling_per_request_min_duration", {
|
("profiling_per_request_min_duration", {
|
||||||
"value": "3",
|
"value": "3",
|
||||||
"help": "log profiling data per request minimum duration (seconds)",
|
"help": "log profiling data per request minimum duration (seconds)",
|
||||||
|
|||||||
Reference in New Issue
Block a user