You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Paul Russell <pa...@luminas.co.uk> on 2000/07/03 17:04:42 UTC

[C2] StatusGenerator

Hi guys,

Attatched is an *incredibly* early version of the StatusGenerator
I was fiddling with yesterday evening. At the moment all it's
doing is extracting info from the java environment - we need
some hooks into the rest of the cocoon architecture to get
statistics etc. from the engine. I'm lobbing this code in early
because (a) I'm 'a bit busy' at the moment (as you've probably
noticed from my extended silences ATM) and (b) I think this is
*just* the kind of thing that people might like to play with as
a gentle introduction to the codebase.

Questions:

 1) How should we go about extracting performance/operating
    statistics from Cocoon? Two possibilities occour:

    * Write a filter that gathers statistics from the pages
      as they are served (number of 'hits', time taken to
      serve each page, that kind of thing).

      This would have a configuration overhead, as you'd have
      to place the filter in the Sitemap for all the sections
      you wanted to monitor..

      ..on the other hand it would allow separate statistics
      for different 'zones' of the site, and you could use a
      conditional sitemap to turn off statistics if the server
      was too busy.

    * Provide hooks into the Cocoon class itself.

      Less config overhead, but less flexible, and always
      carries the runtime overhead whether the statistics
      are wanted or not.

  2) Anyone got any bright ideas how you can measure the load
     on a host from within Java? I can't think of any platform
     independant way...

Thoughts? Comments?

-- 
Paul Russell                               <pa...@luminas.co.uk>
Technical Director,                   http://www.luminas.co.uk
Luminas Ltd.

Re: [C2] StatusGenerator

Posted by Peter Donald <do...@mad.scientist.com>.
At 12:34  3/7/00 -0700, you wrote:
>With this model, doing something like:
>
>>     * Write a filter that gathers statistics from the pages
>>       as they are served (number of 'hits', time taken to
>>       serve each page, that kind of thing).
>
>wouldn't be difficult, though I'd reserve it for more "advanced"
>statistical information (collecting site usage data, e.g.).

It would also be useful to track how much time was spent each stage of
pipeline when serving pages. Profiling like this would allow you to find
the most resource hungry stages by getting max value of (hitcount * stage
cost). Hence you know exactly where to improve your site :P


Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*

Re: [C2] StatusGenerator

Posted by Jonathan Stimmel <jo...@stimmel.net>.
On Mon, Jul 03, 2000 at 04:04:42PM +0100, Paul Russell wrote:

>  1) How should we go about extracting performance/operating
>     statistics from Cocoon? Two possibilities occour:

How about introducing an interface which components may implement
to spit out status information. StatusGenerator would then just
get a list of each type of component from Cocoon, and if it
implements the interface, calls the appropriate method to spit
out SAX events (which would presumably be sent to an XSL stylesheet).

With this model, doing something like:

>     * Write a filter that gathers statistics from the pages
>       as they are served (number of 'hits', time taken to
>       serve each page, that kind of thing).

wouldn't be difficult, though I'd reserve it for more "advanced"
statistical information (collecting site usage data, e.g.).

Re: [C2] StatusGenerator

Posted by Giacomo Pati <Gi...@pwr.ch>.
On Mon, Jul 03, 2000 at 07:40:40PM +0100, Ross Burton wrote:
> >  1) How should we go about extracting performance/operating
> >     statistics from Cocoon? Two possibilities occour:
> 
> public class Cocoon implements Generator?

I think the generated SitemapProcessor could keep track of this kind of information.

> The Cocoon engine knows everything we want to examine (configuration,
> pipelines etc) and can keep track of timings for pipelines if required.

In the future the Cocoon engine will only initiate the generation/compilation/instanciation of the SitemapProcessor to pass them the requests.

Giacomo 

-- 
PWR GmbH, Organisation & Entwicklung      Tel:   +41 (0)1 856 2202
Giacomo Pati, CTO/CEO                     Fax:   +41 (0)1 856 2201
Hintereichenstrasse 7                     Mailto:Giacomo.Pati@pwr.ch
CH-8166 Niederweningen                    Web:   http://www.pwr.ch


Re: [C2] StatusGenerator

Posted by Ross Burton <ro...@mail.com>.
>  1) How should we go about extracting performance/operating
>     statistics from Cocoon? Two possibilities occour:

public class Cocoon implements Generator?

The Cocoon engine knows everything we want to examine (configuration,
pipelines etc) and can keep track of timings for pipelines if required.

Or is this a silly idea?

Ross Burton



Re: [C2] StatusGenerator

Posted by Paul Russell <pa...@luminas.co.uk>.
On Mon, Jul 03, 2000 at 11:23:07PM +0200, Stefano Mazzocchi wrote:
> Paul Russell wrote:
> > Attatched is an *incredibly* early version of the StatusGenerator
> > I was fiddling with yesterday evening.
> Cool. :)

Heh. that's what I like about you, easily please. If only I had the
time to put some *proper* work in. Dayjobs, grr ;)

> Nah, this should be "built-in" inside the component pipe, otherwise you
> have to specify this everytime.

Yep. Makes sense. I was playing with the generating code earlier, and
I get the impression it's a little too early to start thinking about
adding hooks ;)

Is there anything I can usefully do to help with the implementation of
the sitemap code?

> No, I'd rather recompile the sitemap with statistics turned off.

Agreed.

> I think the sitemap should take care of these statistics...

And again..

> >   2) Anyone got any bright ideas how you can measure the load
> >      on a host from within Java? I can't think of any platform
> >      independant way...
> Neither do I :-( 

Damn.

> Anyway, platform dependency here would not that bad... stuff like
> Runtime.exec("uptime"). Of course, there is no win32 nor MacOS
> equivalent for this.... but it's better than nothing.

Yeah, I guess. It's a shame though, isn't it. Perhaps I should
knock up an API for system health monitoring - I need it for a
few other projects too.

-- 
Paul Russell                               <pa...@luminas.co.uk>
Technical Director,                   http://www.luminas.co.uk
Luminas Ltd.

Re: [C2] StatusGenerator

Posted by Stefano Mazzocchi <st...@apache.org>.
Paul Russell wrote:
> 
> Hi guys,
> 
> Attatched is an *incredibly* early version of the StatusGenerator
> I was fiddling with yesterday evening.

Cool. :)

> At the moment all it's
> doing is extracting info from the java environment - we need
> some hooks into the rest of the cocoon architecture to get
> statistics etc. from the engine. I'm lobbing this code in early
> because (a) I'm 'a bit busy' at the moment (as you've probably
> noticed from my extended silences ATM) and (b) I think this is
> *just* the kind of thing that people might like to play with as
> a gentle introduction to the codebase.

I totally agree, this is a great addition to the platform and a nice
"playground" for people willing to help around.
 
> Questions:
> 
>  1) How should we go about extracting performance/operating
>     statistics from Cocoon? Two possibilities occour:
> 
>     * Write a filter that gathers statistics from the pages
>       as they are served (number of 'hits', time taken to
>       serve each page, that kind of thing).

Nah, this should be "built-in" inside the component pipe, otherwise you
have to specify this everytime.
 
>       This would have a configuration overhead, as you'd have
>       to place the filter in the Sitemap for all the sections
>       you wanted to monitor..
> 
>       ..on the other hand it would allow separate statistics
>       for different 'zones' of the site, and you could use a
>       conditional sitemap to turn off statistics if the server
>       was too busy.

No, I'd rather recompile the sitemap with statistics turned off.
 
>     * Provide hooks into the Cocoon class itself.
> 
>       Less config overhead, but less flexible, and always
>       carries the runtime overhead whether the statistics
>       are wanted or not.

I think the sitemap should take care of these statistics...
 
>   2) Anyone got any bright ideas how you can measure the load
>      on a host from within Java? I can't think of any platform
>      independant way...

Neither do I :-( 

Anyway, platform dependency here would not that bad... stuff like
Runtime.exec("uptime"). Of course, there is no win32 nor MacOS
equivalent for this.... but it's better than nothing.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------