ANNOUNCE: Apache-Status-DBI-v1.0.0.tar.gz

ANNOUNCE: Apache-Status-DBI-v1.0.0.tar.gz

am 27.03.2007 12:19:13 von Tim.Bunce

file: $CPAN/authors/id/T/TI/TIMB/Apache-Status-DBI-v1.0.0.tar.gz
size: 4562 bytes
md5: 15e92e4c765793ae850191f9b02e8d83

I needed an Apache::Status plugin to show all DBI connections and statements.
I couldn't see one so I wrote one...

It uses the fact that DBI (>= 1.49) now keeps weak refs to child handles,
so it's possible to drill-down through every DBI handle that exists.

I've appended a sample of the output. (It's copied from the web page so
has lost the bolding and dimming that the real output uses in places.)

Enjoy!

Tim.

------------------------------------------------------------ ----------------------------------------------
DBI 1.55 - Drivers, Connections and Statements

4 drivers loaded: DBM, Sponge, ExampleP, Gofer

------------------------------------------------------------ ----------------------------------------------
DBD::DBM version 0.03, 2 dbh (2 cached, 2 active) DBI::dr=HASH(0x18f3010)

DSN "dbm_type=SDBM_File;lockfile=0" DBI::db=HASH(0x193e374)
Attributes: Active, Executed, RaiseError, ShowErrorStatement, AutoCommit
Attributes: ErrCount=1, TraceLevel=0, FetchHashKeyName='NAME', LongReadLen=80, Username=undef
Statement: SELECT dKey, dVal FROM fruit

DSN "dbm_type=SDBM_File;mldbm=;lockfile=0;f_dir=/Users/timbo/dbi /trunk/test_output" DBI::db=HASH(0x192256c)
Attributes: Active, Executed, RaiseError, ShowErrorStatement, AutoCommit
Attributes: ErrCount=0, TraceLevel=0, FetchHashKeyName='NAME', LongReadLen=80, Username=undef
Statement: DELETE FROM SDBM_File_fruit WHERE dVal='to delete'

------------------------------------------------------------ ----------------------------------------------
DBD::ExampleP version 12.009153, 5 dbh (5 cached, 5 active) DBI::dr=HASH(0x18a6bc4)

DSN "." DBI::db=HASH(0x18f0b18)
Attributes: Active, RaiseError, AutoCommit
Attributes: ErrCount=0, TraceLevel=0, FetchHashKeyName='NAME', LongReadLen=80, Username=undef

DSN "" DBI::db=HASH(0x18ef52c)
Attributes: Active, Executed, RaiseError, AutoCommit
Attributes: ErrCount=3, TraceLevel=0, FetchHashKeyName='NAME', LongReadLen=80, Username=''
Statement: SELECT name FROM t
sth: 1 (1 cached, 0 active)

sth DBI::st=HASH(0x195ec00)
Attributes: Executed, RaiseError
Attributes: ErrCount=0, TraceLevel=0, FetchHashKeyName='NAME', LongReadLen=80
Statement: select name from ?
ParamValues: 1='.'
Attributes: NUM_OF_PARAMS=1, NUM_OF_FIELDS=1, CursorName=undef
Rows: 40

------------------------------------------------------------ ----------------------------------------------

Tim.

Re: ANNOUNCE: Apache-Status-DBI-v1.0.0.tar.gz

am 30.03.2007 13:14:01 von Tim.Bunce

On Thu, Mar 29, 2007 at 11:40:02PM -0700, Philip M. Gollucci wrote:
> Tim Bunce wrote:
> > file: $CPAN/authors/id/T/TI/TIMB/Apache-Status-DBI-v1.0.0.tar.gz
> > size: 4562 bytes
> > md5: 15e92e4c765793ae850191f9b02e8d83
> Hi Tim,
> I don't seem to have commit access to this repo yet.
>
> no rush, I'm on vacation until April 11th starting now! :)

Enjoy!

> The attached diff does this:
>
> o Port to be mod_perl1.x and mod_perl2.x compliant

Great.

> o version.pm is only distributed with 5.9.x+ so lets not require it

Fine. (I used Module::Starter::PBP to start the module and it used version.)

> o fix Test::Pod::Coverage complaints for
> public API documentation for apache_status_dbi_handles
> o minor indentation

Thanks. Checked in a r9366.

I've changed the version from '1.0.1' to '1.01' as I'd rather avoid
three-part numbers if we're not using version.pm.
Also I needed to change the elsif to else in the mod_perl2 module
loading code to get it to work for my mod_perl1.

Tim.

p.s. email to svn-commit-modules-Apache-Status-DBI-subscribe@perl.org
to be subscribed to the svn commit list.

Re: ANNOUNCE: Apache-Status-DBI-v1.0.0.tar.gz

am 30.03.2007 22:47:49 von darren

At 12:14 PM +0100 3/30/07, Tim Bunce wrote:
>I've changed the version from '1.0.1' to '1.01' as I'd rather avoid
>three-part numbers if we're not using version.pm.
>Also I needed to change the elsif to else in the mod_perl2 module
>loading code to get it to work for my mod_perl1.

Tim, the best thing to do then is make it version 1.000001, which is
equal to 1.0.1. That way, in the future when version.pm is
ubiquitous and you want to switch back, it is seamless. Or if that
is too long, then use 1.001 instead, which is equivalent to 1.1.0.
But using 1.01, equal to 1.10.0, is just wrong and should be avoided,
especially for new projects that don't have prior releases in 1.xx
format. -- Darren Duncan

Re: ANNOUNCE: Apache-Status-DBI-v1.0.0.tar.gz

am 31.03.2007 00:57:47 von Tim.Bunce

On Fri, Mar 30, 2007 at 01:47:49PM -0700, Darren Duncan wrote:
> At 12:14 PM +0100 3/30/07, Tim Bunce wrote:
> >I've changed the version from '1.0.1' to '1.01' as I'd rather avoid
> >three-part numbers if we're not using version.pm.
> >Also I needed to change the elsif to else in the mod_perl2 module
> >loading code to get it to work for my mod_perl1.
>
> Tim, the best thing to do then is make it version 1.000001, which is
> equal to 1.0.1. That way, in the future when version.pm is
> ubiquitous and you want to switch back, it is seamless. Or if that
> is too long, then use 1.001 instead, which is equivalent to 1.1.0.
> But using 1.01, equal to 1.10.0, is just wrong and should be avoided,
> especially for new projects that don't have prior releases in 1.xx
> format. -- Darren Duncan

Okay. Thanks Duncan. The next release will be 1.011.

Tim.