libgs.monitoring.Monitor¶
-
class
libgs.monitoring.Monitor(workers=10, tick=0.5, tick_cb=<function <lambda>>, default_dt=10)[source]¶ Class to provide functionality for monitoring
Parameters: - workers – Maximum number of simultaneouse threads to spawn in the ThreadPool
- tick – The delay between successive runs of the monitor loop. Should be fairly small (< 1 sec).
- tick_cb – A callback that can be invoked at the end of every tick.
- default_dt – Default dt to apply to monitor generators (if dt not specified explicitly)
Methods
add_callback(callable)Add a callable to be invoked every N times a value is polled. callback()Decorator to convert a function definition to an IntervalCallback instance and add it to the monitor’s callback list. itertree([parent])keys()Just include this since dicts etc all use keys to describe the access keys. monitor([point])Creates a decorator that can be applied to any function to add it to be monitored. names()register_monitor(name, gen[, dt, parent, …])This is a low level function to register a monitor generator with the monitor class. register_parent(name[, parent])A parent monitor is not really a monitor. start([subprocess])stop()to_gen_in_executor(fn, point_names, *args, …)This decorator will take any function and turn it into a generator that always returns immediately after calls to next(). Attributes
alertcode