profiling: default is now 'none' and config option will be checked instantly

This commit is contained in:
Peter Bieringer
2025-12-08 17:54:18 +01:00
parent 0776b1bdd0
commit 15ebb1e647
3 changed files with 14 additions and 8 deletions

View File

@@ -1696,9 +1696,10 @@ _(>= 3.5.10)_
Log profiling data on level=info
Default: `per_request`
Default: `none`
One of
* `none` (disabled)
* `per_request` (above minimum duration)
* `per_request_method` (regular interval)

4
config
View File

@@ -322,8 +322,8 @@
#storage_cache_actions_on_debug = False
# Log profiling data on level=info
# Value: per_request | per_request_method
#profiling = per_request_method
# Value: per_request | per_request_method | none
#profiling = none
# Log profiling data per request minium duration (seconds)
#profiling_per_request_min_duration = 3

View File

@@ -41,12 +41,12 @@ from radicale import auth, hook, rights, storage, types, web
from radicale.hook import email
from radicale.item import check_and_sanitize_props
from radicale import app # isort:skip (circular import issue)
DEFAULT_CONFIG_PATH: str = os.pathsep.join([
"?/etc/radicale/config",
"?~/.config/radicale/config"])
PROFILING: Sequence[str] = ("per_request", "per_request_method", "none")
def positive_int(value: Any) -> int:
value = int(value)
@@ -72,6 +72,12 @@ def logging_level(value: Any) -> str:
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:
if not value:
return ""
@@ -584,10 +590,9 @@ This is an automated message. Please do not reply.""",
"help": "log storage cache action on level=debug",
"type": bool}),
("profiling", {
"value": "per_request_method",
"value": "none",
"help": "log profiling data level=info",
"type": str,
"internal": app.PROFILING}),
"type": profiling}),
("profiling_per_request_min_duration", {
"value": "3",
"help": "log profiling data per request minimum duration (seconds)",