| Trees | Indices | Help |
|
|---|
|
|
object --+
|
ZenUtils.CmdBase.CmdBase --+
|
ZenUtils.ZenDaemon.ZenDaemon --+
|
ZenUtils.ZCmdBase.ZCmdBase --+
|
ZenHub
Listen for changes to objects in the Zeo database and update the
collectors' configuration.
The remote collectors connect the ZenHub and request configuration
information and stay connected. When changes are detected in the
Zeo database, configuration updates are sent out to collectors
asynchronously. In this way, changes made in the web GUI can
affect collection immediately, instead of waiting for a
configuration cycle.
Each collector uses a different, pluggable service within ZenHub
to translate objects into configuration and data. ZenPacks can
add services for their collectors. Collectors communicate using
Twisted's Perspective Broker, which provides authenticated,
asynchronous, bidirectional method invocation.
ZenHub also provides an XmlRPC interface to some common services
to support collectors written in other languages.
ZenHub does very little work in its own process, but instead dispatches
the work to a pool of zenhubworkers, running zenhubworker.py. zenhub
manages these workers with 3 data structures:
- workers - a list of remote PB instances
- worker_processes - a set of WorkerRunningProtocol instances
- workerprocessmap - a dict mapping pid to process instance created
by reactor.spawnprocess
Callbacks and handlers that detect worker shutdown update these
structures automatically. ONLY ONE HANDLER must take care of restarting
new workers, to avoid accidentally spawning too many workers. This
handler also verifies that zenhub is not in the process of shutting
down, so that callbacks triggered during daemon shutdown don't keep
starting new workers.
TODO: document invalidation workers
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from Inherited from Inherited from |
|||
|
|||
totalTime = 0.
|
|||
totalEvents = 0
|
|||
totalCallTime = 0.
|
|||
name = 'zenhub'
|
|||
|
Inherited from Inherited from |
|||
|
|||
Hook ourselves up to the Zeo database and wait for collectors to connect.
|
Periodically (once a second) process database changes
|
Perform one cycle of update notifications.
|
Useful method for posting events to the EventManager.
|
Load the password file
|
Helper method to load services dynamically for a collector. Returned instances are cached: reconnecting collectors will get the same service object.
|
Take a remote request and queue it for worker processes.
|
Start a worker subprocess
|
Since we don't do anything on a regular basis, just push heartbeats regularly.
|
Adds our command line options to ZCmdBase command line options.
|
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1.1812 on Mon Jul 30 17:10:57 2012 | http://epydoc.sourceforge.net |