Monitoring¶
-
uwsgiconf.runtime.monitoring.
register_file_monitor
(filename: str, *, target: Union[str, int, uwsgiconf.runtime.signals.Signal] = None)¶ Maps a specific file/directory modification event to a signal.
Parameters: - filename – File or a directory to watch for its modification.
- target –
Existing signal to raise or Signal Target to register signal implicitly.
Available targets:
workers
- run the signal handler on all the workersworkerN
- run the signal handler only on worker Nworker
/worker0
- run the signal handler on the first available workeractive-workers
- run the signal handlers on all the active [non-cheaped] workersmules
- run the signal handler on all of the mulesmuleN
- run the signal handler on mule Nmule
/mule0
- run the signal handler on the first available mulespooler
- run the signal on the first available spoolerfarmN/farm_XXX
- run the signal handler in the mule farm N or named XXX
Raises: ValueError – If unable to register monitor.
-
class
uwsgiconf.runtime.monitoring.
Metric
(name: str)¶ User metric related stuff.
Note
One needs to register user metric beforehand. E.g.::
section.monitoring.register_metric(section.monitoring.metric_types.absolute('mymetric'))
Parameters: name – Metric name. -
value
¶ Current metric value.
-
set
(value: int, *, mode: str = None) → bool¶ Sets metric value.
Parameters: - value – New value.
- mode –
Update mode.
- None - Unconditional update.
- max - Sets metric value if it is greater that the current one.
- min - Sets metric value if it is less that the current one.
-
incr
(delta: int = 1) → bool¶ Increments the specified metric key value by the specified value.
Parameters: delta –
-
decr
(delta: int = 1) → bool¶ Decrements the specified metric key value by the specified value.
Parameters: delta –
-
mul
(value: int = 1) → bool¶ Multiplies the specified metric key value by the specified value.
Parameters: value –
-
div
(value: int = 1) → bool¶ Divides the specified metric key value by the specified value.
Parameters: value –
-