You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Malcolm J Harwood <mj...@liminalflux.net> on 2005/03/02 19:22:35 UTC
Apache::Scoreboard problem
I'm trying to get some per-request stats for the entire request, not just the
response phase, and Apache::Scoreboard looked like it would do the job.
However, I'm having a few problems with it.
I have the following installed as a CleanupHandler (by which time everything
should be done), it's just test code to try out Apache::Scoreboard so I'm not
doing anything fancy with the data. As much as possible it's pulled straight
from the docs.
sub handler
{
my $r = shift;
my $sp = $r->pool->new;
my $image = Apache::Scoreboard->image($sp);
for (my $parent_score = $image->parent_score;
$parent_score;
$parent_score = $parent_score->next)
{
next unless ($parent_score->pid == $$); # only want this process
my $server = $parent_score->server; #Apache::ServerScore object
next unless $server;
warn "count: ", $server->access_count;
warn "request: ", $server->request;
warn "served: ", $server->bytes_served;
warn "conn_bytes : ", $server->conn_bytes ;
warn "conn_count : ", $server->conn_count ;
warn "req_time : ", $server->req_time ;
}
}
However, on use, I get the following:
Can't locate object method "server" via package
"Apache::ScoreboardParentScore"
According to the docs, that should be Apache::ParentScore not
Apache::ScoreboardParentScore.
I'm currently using: Apache/2.0.52, mod_perl 2.0.0_RC3 and Apache::Scoreboard
2.05.
Is there something obvious I'm doing wrong?
Re: Apache::Scoreboard problem
Posted by Stas Bekman <st...@stason.org>.
Malcolm J Harwood wrote:
> On Wednesday 02 March 2005 11:14 pm, Stas Bekman wrote:
>
>
>>I've revamped the docs, but it's still incomplete (takes too much time).
>>Please take a look at:
>>http://apache.org/~stas/Apache-Scoreboard-2.06.tar.gz
>
>
> It looks fine from a quick once-over (at least relative to what I worked out
> looking at the source).
Thanks, Malcolm. So I'll get a new version out, soon.
> Am I correct in assuming that under pre-fork there would be only one
> worker_score per parent_score?
That's correct. Patches to improve the docs (as you discover things) are
very welcome.
Your best tutorial is Apache::VMonitor 2.x.
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Apache::Scoreboard problem
Posted by Malcolm J Harwood <mj...@liminalflux.net>.
On Wednesday 02 March 2005 11:14 pm, Stas Bekman wrote:
> I've revamped the docs, but it's still incomplete (takes too much time).
> Please take a look at:
> http://apache.org/~stas/Apache-Scoreboard-2.06.tar.gz
It looks fine from a quick once-over (at least relative to what I worked out
looking at the source).
Am I correct in assuming that under pre-fork there would be only one
worker_score per parent_score?
--
"Truth comes in three stages. First, it is disbelieved; second
it is violently opposed; third it is accepted as self-evident."
- Schopenhauer
Re: Apache::Scoreboard problem
Posted by Stas Bekman <st...@stason.org>.
Malcolm J Harwood wrote:
> I'm trying to get some per-request stats for the entire request, not just the
> response phase, and Apache::Scoreboard looked like it would do the job.
> However, I'm having a few problems with it.
[...]
> my $server = $parent_score->server; #Apache::ServerScore object
Malcomlm, the docs coming with 2.05 were a copy of 0.x version's docs.
This method is now worker_score().
I've revamped the docs, but it's still incomplete (takes too much time).
Please take a look at:
http://apache.org/~stas/Apache-Scoreboard-2.06.tar.gz
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com