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 workers
    • workerN - run the signal handler only on worker N
    • worker/worker0 - run the signal handler on the first available worker
    • active-workers - run the signal handlers on all the active [non-cheaped] workers
    • mules - run the signal handler on all of the mules
    • muleN - run the signal handler on mule N
    • mule/mule0 - run the signal handler on the first available mule
    • spooler - run the signal on the first available spooler
    • farmN/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