You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ian Holsman <Ia...@cnet.com> on 2001/06/12 00:32:22 UTC

RE: [PATCH] mgmt_get_vars hook (was RE: Hooks for management repo rting)

> -----Original Message-----
> From: William A. Rowe, Jr. [mailto:admin@rowe-clan.net]
> Sent: Monday, June 11, 2001 3:08 PM
> To: new-httpd@apache.org
> Subject: Re: [PATCH] mgmt_get_vars hook (was RE: Hooks for management
> reporting)
> 
> 
> From: "Ian Holsman" <Ia...@cnet.com>
> Sent: Monday, June 11, 2001 4:06 PM
> 
> 
> > Ok..
> > Part 1.. adding the hook
> > 
> > once this gets approved/commited
> > I'll work on implementing the hook in scoreboard and the mpm's 
> 
> Let me understand 100%, we are _not_ using a hook to 
> populate, only to retrieve

YES.

> data, and that will not be heavily string intensive, so we 
> won't laden the server
> with unnecessary cpu.  Yes?

I was thinking that there would be a 'description' and a 'module' field with 
each number which would describe what the value represents.
the 'scoreboard.requests.total' key would have a description 'The Total # of requests served since
apache was started' and a module 'scoreboard'. which would be apr_pstrdup'ed in.

this could be removed, and the keys could be documented in the module doc's now if you would
prefer.

..Ian



> 
> Bill
> 
> 

Re: [PATCH] mgmt_get_vars hook

Posted by Greg Stein <gs...@lyra.org>.
On Mon, Jun 11, 2001 at 03:32:22PM -0700, Ian Holsman wrote:
> > -----Original Message-----
> > From: William A. Rowe, Jr. [mailto:admin@rowe-clan.net]
>...
> > data, and that will not be heavily string intensive, so we 
> > won't laden the server
> > with unnecessary cpu.  Yes?
> 
> I was thinking that there would be a 'description' and a 'module' field with 
> each number which would describe what the value represents.
> the 'scoreboard.requests.total' key would have a description 'The Total # of requests served since
> apache was started' and a module 'scoreboard'. which would be apr_pstrdup'ed in.

There is absolutely no need to strdup those strings. They are constant
strings that survive forever. It is silly to copy them to the heap. Just
say:

    item = apr_pcalloc(p, sizeof(*item));
    item->description = "Combat boot size";
    item->name = "mom.feet.boot-size";
    ...

Just make sure to change the description/module to "const char *", and you
should be set. The string value (in the union type) should be const-ified,
too.

I would also recommend changing "module" to "name". Each item can specify
its name, rather than just the defining module. (and if we use a dotted name
as the precedent, then "module" can also be extracted)

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/