How to use querylog plugin...

View: New views
5 Messages — Rating Filter:   Alert me  

How to use querylog plugin...

by Marcello Romani :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hallo,
     I've installed C::P::QueryLog and installed the template provided
by the pod doc, but I always get 0.00 seconds of elapsed time, no matter
how many db accesses I do.
The DBIC::Querylog doc made me think that perhaps I need to explicitly
assign the querylog object to the schema storage, and activate its debug
flag. But I understand that the connection is not made until some db
data is actually needed...

My question is therefore this: is there something I need to setup in the
app config to make querylog collect data ?

Thanks in advance.

--
Marcello Romani
Responsabile IT
Ottotecnica s.r.l.
http://www.ottotecnica.com

_______________________________________________
List: Catalyst@...
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@.../
Dev site: http://dev.catalyst.perl.org/

Re: How to use querylog plugin...

by Matt S Trout-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Sep 12, 2007 at 04:13:36PM +0200, Marcello Romani wrote:
> Hallo,
>     I've installed C::P::QueryLog and installed the template provided
> by the pod doc, but I always get 0.00 seconds of elapsed time, no matter
> how many db accesses I do.

Uninstall it and use the replacement model mixin the author wrote after
discussions on here about why it shouldn't have been a plugin.

--
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director    Want a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/                    http://www.shadowcat.co.uk/ 

_______________________________________________
List: Catalyst@...
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@.../
Dev site: http://dev.catalyst.perl.org/

Re: How to use querylog plugin...

by Marcello Romani :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Matt S Trout ha scritto:
> On Wed, Sep 12, 2007 at 04:13:36PM +0200, Marcello Romani wrote:
>> Hallo,
>>     I've installed C::P::QueryLog and installed the template provided
>> by the pod doc, but I always get 0.00 seconds of elapsed time, no matter
>> how many db accesses I do.
>
> Uninstall it and use the replacement model mixin the author wrote after
> discussions on here about why it shouldn't have been a plugin.
>

Well in fact I'm not using that pulgin at all... (I just installed it -
sorry for not thinking twice before writing).
I'm testing it in two separate ways: by using
C::M::DBIC::Schema::QueryLog as base class for my model class, and by
attaching a DBIx::Class::QueryLog object to the $schema instance.

The problem is that the querylog object doesn't collecte any data (or so
it seems to me, since the stats are all zero...)

I think I'll build a simple "dummy" app just for testing the querylog,
so I get to "know" it (I'm trying to use it in a non-trivial app).
Sometimes in order to solve a problem you need to isolate it...

Thanks.

--
Marcello Romani
Responsabile IT
Ottotecnica s.r.l.
http://www.ottotecnica.com

_______________________________________________
List: Catalyst@...
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@.../
Dev site: http://dev.catalyst.perl.org/

Re: How to use querylog plugin...

by Marcello Romani :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Marcello Romani ha scritto:

> Matt S Trout ha scritto:
>> On Wed, Sep 12, 2007 at 04:13:36PM +0200, Marcello Romani wrote:
>>> Hallo,
>>>     I've installed C::P::QueryLog and installed the template provided
>>> by the pod doc, but I always get 0.00 seconds of elapsed time, no
>>> matter how many db accesses I do.
>>
>> Uninstall it and use the replacement model mixin the author wrote after
>> discussions on here about why it shouldn't have been a plugin.
>>
>
> Well in fact I'm not using that pulgin at all... (I just installed it -
> sorry for not thinking twice before writing).
> I'm testing it in two separate ways: by using
> C::M::DBIC::Schema::QueryLog as base class for my model class, and by
> attaching a DBIx::Class::QueryLog object to the $schema instance.
>
> The problem is that the querylog object doesn't collecte any data (or so
> it seems to me, since the stats are all zero...)
>
> I think I'll build a simple "dummy" app just for testing the querylog,
> so I get to "know" it (I'm trying to use it in a non-trivial app).
> Sometimes in order to solve a problem you need to isolate it...
>
> Thanks.
>

Ok, I've written a very small app that only has one table
(users(id,name,email)) and a couple of methods (create, list). The app's
model use base C::M::DBIC::Schema::QueryLog.
Now my problem is how to obtain the querylog object used in the template
from the docs...

Thanks.

--
Marcello Romani
Responsabile IT
Ottotecnica s.r.l.
http://www.ottotecnica.com

_______________________________________________
List: Catalyst@...
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@.../
Dev site: http://dev.catalyst.perl.org/

Re: How to use querylog plugin...

by Marcello Romani :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Marcello Romani ha scritto:

> Marcello Romani ha scritto:
>> Matt S Trout ha scritto:
>>> On Wed, Sep 12, 2007 at 04:13:36PM +0200, Marcello Romani wrote:
>>>> Hallo,
>>>>     I've installed C::P::QueryLog and installed the template
>>>> provided by the pod doc, but I always get 0.00 seconds of elapsed
>>>> time, no matter how many db accesses I do.
>>>
>>> Uninstall it and use the replacement model mixin the author wrote after
>>> discussions on here about why it shouldn't have been a plugin.
>>>
>>
>> Well in fact I'm not using that pulgin at all... (I just installed it
>> - sorry for not thinking twice before writing).
>> I'm testing it in two separate ways: by using
>> C::M::DBIC::Schema::QueryLog as base class for my model class, and by
>> attaching a DBIx::Class::QueryLog object to the $schema instance.
>>
>> The problem is that the querylog object doesn't collecte any data (or
>> so it seems to me, since the stats are all zero...)
>>
>> I think I'll build a simple "dummy" app just for testing the querylog,
>> so I get to "know" it (I'm trying to use it in a non-trivial app).
>> Sometimes in order to solve a problem you need to isolate it...
>>
>> Thanks.
>>
>
> Ok, I've written a very small app that only has one table
> (users(id,name,email)) and a couple of methods (create, list). The app's
> model use base C::M::DBIC::Schema::QueryLog.
> Now my problem is how to obtain the querylog object used in the template
> from the docs...
>
> Thanks.
>

For future reference: if the model is

MyApp::Model::Main

then one can access the querylog object by calling:

$c->model('Main')->querylog

--
Marcello Romani
Responsabile IT
Ottotecnica s.r.l.
http://www.ottotecnica.com

_______________________________________________
List: Catalyst@...
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@.../
Dev site: http://dev.catalyst.perl.org/