List Info

Thread: Re: Catalyst::Plugin::DBIC::QueryLog




Re: Catalyst::Plugin::DBIC::QueryLog
country flaguser name
China
2007-09-04 06:02:08
see attachment. check if it's OK?

now it's not per request any more. hmm, after several
requests,

Total SQL Time: 1.033088 seconds
Total Queries: 115

it will increasing. hmm, how to make it as per request?

Thanks, mst. (I'll send u a htpasswd line after all is OK.)


Matt S Trout wrote:
> On Tue, Sep 04, 2007 at 01:19:31AM +0000, Fayland Lam
wrote:
>> Matt S Trout wrote:
>>> On Sat, Sep 01, 2007 at 04:08:09AM +0000,
Fayland Lam wrote:
>>>> hi, guys.
>>>>
>>>> since I can't touch Cory Watson by
gphatcpan.org <mailto:gphatcpan.org>
>>>> so I wonder if this module is fine?
>>> No, it's awful. There's no reason at all for
this to be a plugin.
>>>
>>> I'd suggest you make it a mixin for
Catalyst::Model:BIC::Sch
ema instead.
>>
>> but it depends on every request. it start at the
sub prepare and end 
>> before finalize_body. due to my limited knowledge,
I'm not sure if it's 
>> OK as a mixin for Catalyst::Model:BIC::Sch
ema
> 
> I'm sure it is.
> 
> You just have a per-request query log.
> 
> That's trivial with
Catalyst::Component::InstancePerContext.
>  
>>> (otherwise how do you deal with two DBIC models
each with their own
>>> querylog etc. etc.)
>> that's right. but there is more than one way to do
it. 
> 
> Yes, but yours is wrong.
> 
> We've documented this clearly in ExtendingCatalyst - if
it doesn't need
> to affect the request cycle, it shouldn't be a plugin.
> 
> Please send me an htpasswd line so I can set up
Model:BIC::Sch
ema::QueryLog
> dirs for you (or consider just submitting a patch to
M:BIC::Sch
ema itself,
> which I'd be happy to help with)
> 


-- 
Fayland Lam // http://www.fayland.org/

_______________________________________________
List: Catalystlists.rawmode.org
Listinfo: ht
tp://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-
archive.com/catalystlists.rawmode.org/
Dev site: http://dev.catalyst.per
l.org/

  
Re: Re: Catalyst::Plugin::DBIC::QueryLog
country flaguser name
United States
2007-09-04 06:15:32
Fayland Lam wrote:
> see attachment. check if it's OK?
>
> now it's not per request any more. hmm, after several
requests,
mst wrote:
> That's trivial with
Catalyst::Component::InstancePerContext.

He intended for you to use that. 

It implements the per-request magic for you with some clever
use of
ACCEPT_CONTEXT and the stash.  Basically, it calls your
builder method
if you don't already have an instance in $c->stash. 
Since that gets
cleared every request, you get your per-request.

So, try again   You're
almost there 

Regards,
Jonathan Rockway


_______________________________________________
List: Catalystlists.rawmode.org
Listinfo: ht
tp://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-
archive.com/catalystlists.rawmode.org/
Dev site: http://dev.catalyst.per
l.org/

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )