HI,
At this very moment I am trying to understand what Ian really wants.
This is what I understand of it.
We need to have a hook that each time actively updates data.
Meaning it will update at a certain point all data for all modules.
I beleive this is not really the way to go. FIrst of all, when do you
have a certain state change or something usefull to register.
Most likely the time (or place in the code) will be for all modules
different.
This is what I think is neccessary to serve the management processes/
applications better. These could be either mod_status, mod_backhand,
mod_xml_status (this is just status in XML format), SNMP whatever.
There needs to be a generic ability for administration of
key/value pair. Via this generic system every module may
register a key/value pair. The Key would then be the item
that uniquely identifies the registered value. The value
itself needs to be of arbitrary sort, meaning it may be a
structure. The value is then a pointer to the memory where
the perticular module updates (if the module thinks is needed)
the information in the value.
Why is the value part a pointer to some struct and
not the real value. For instance, if a module just
wants to maintain a counter that module can do,
counter++, where counter is the varialbe updated.
Otherwise, that module needs to dofirst a retrieval
of the variable, then a counter++ and a store.
On top of this I am maybe even thinking this needs to
be a pointer to a function, because that way we
can have always the same API towards the management
data and changes within the management data are
possible. The ap_mpm_show(...) is here an example of.
Any management module, can if needed require the kay/value pair
and have the information assoicated. How the management module
will handle this and present it to the user is up to the module.
Also the management module must have knowledge of the key/value pairs
it needs for perticular information and how it is stored. Unfortenate,
but I beleive we can not go really around this. If I use SNMP as an
example, I can provide an SNMP-based access to the information
in the scoreboard. However, the SNMP module needs to know the
correct mapping from the structure representing the scoreboard into
the managed objects of the MIB module.
For those who would say if it reagrds a structure we need
to split this into multiple key/value pairs it would become
way to quick a mess to maintain single values. The management
module (if needed) needs to sort this out for itself, together
with the module that registered it. For instance, I know
that lots of management data in SNMP is or single value or
row-based. Mod_status is equal, it present a table with rows
containing information of the current activity.
What type of hook do we really need it a management data registration
hook and a a management process fork hook. I beleive this can be
done within 1 single hook. That hook needs to be made just after the
scoreboard is made. Although, one could argue that the creating of
the scoreboard is also registration of management data.
This hook is needed inside the MPM and I am thinking of
something as followed.
1) Setup scoreboard
2) Execute hook: register management data/fork management processes.
NOTE: not all management processes need to fork of a process.
NOTE: The management data could be shared memory and registering
the access to it.
3) normal MPM execution as implemented already.
Why do I believe that the hook can be combined.
The management processes do not relly need to register
management date in the generic key/value pair mechanism.
They can and need to maintain to manage it internal.
Therefore, the management registration in the modules
can be done first in the same hook after which the management
processes can fork off.
I would like to note that I use forking as an example, if
a system would not support forking it may as well be a thread.
Just as a side note I would like to mention that sometimes a push
mechanism is needed for having, for instance, an SNMP notification
(trap), you could use therefore the new error_log hook. SNMP
notification are normally only used for exceptional situations and
those (if SNMP not used) should also be logged in the error-log.
Harrie
--
address: Covalent Technologies, 645 Howard St, San Francisco, CA - 94105
phone: +1-415-536-5221 fax:+1-415-536-5210
personal website: http://www.lisanza.net/