State and Workflow Overhaul

2 views
Skip to first unread message

Duncan McGreggor

unread,
May 3, 2006, 8:41:05 PM5/3/06
to Python Monitoring Application
So one of the biggest problems I've encountered in splitting things up
in pymon has been around monitor state and rules processing. This is
not surprising, considering the chaos that was going on when these
parts were written.

I'm bringing workflow back into the mix, and spent several hours with
pen and paper last night plotting out all sorts of approaches. Below is
what's in the TODO file regarding this matter (not committed to svn
yet). Again, it is key to remember that these changes are being made
such that each component of pymon can operate independently, as log as
the other components provide what is needed.

o Get rid of application.State's current use of backing up
. have State subclass twisted.persisted.sob.Persistent
. for regular backups, call
monitorStateInstance.save(filename=...)
. note: regular backups are called by a TimerService in the
main loop
. for restoring data, simply use twisted.persisted.sob.load()
o Rename application.State to application.BaseState (subclassing
Persistent)
o Create application.CheckData, a dictionary with default values
o Move workflow.ServiceState to application
o ServiceState needs to subclass workflow.base.WorkflowAware
o Plug rules processing into ServiceState methods
o Have monitors subclass ServiceState and override appropriate
methods
o Revamp application.MonitorState
. MonitorState subclasses BaseState
. __init__() instantiates a CheckState and assigns it to an
attribute
. checkStateInstance gets updated with all service changes;
it's the
run-time data for the Monitor
. __init__() instantiates ServiceState and assigns it to an
attribute
. serviceStateInstance needs to have access to
checkStateInstance
o Upon monitors parsing/proccessing returned network data:
. monitorStateInstance.workflow.doTrans(this_transition_name)
. doTran() will initiate the actions appropriate for that
particular
transition

Duncan McGreggor

unread,
May 5, 2006, 4:28:48 AM5/5/06
to Python Monitoring Application

On May 3, 2006, at 6:41 PM, Duncan McGreggor wrote:

> Below is what's in the TODO file regarding this matter

[snip]

Much of the work on that TODO I posted is now finished. pymon is now
using twisted.persisted.sob (persistence for Small OBjects). All state
information is persisted according to this mechanism and it has really
cleaned up the pymon code. In addition, there is a much more logical
and structured relationship between a state, it's persisting machinery,
and the state's data. The old workflow has partially been tied in as
well. Of course, now I am making changes to the workflow code, so we'll
have to see how that shakes out.

d

Reply all
Reply to author
Forward
0 new messages