You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Ian Connor <ia...@gmail.com> on 2010/02/11 19:07:47 UTC

Has anyone done request logging with Solr-Ruby for use in Rails?

The idea is that in the log is currently like:

Completed in 1290ms (View: 152, DB: 75) | 200 OK [
http://localhost:3000/search?q=nik+gene+cluster&view=2]

I want to extend it to also track the Solr query times and time spent in
solr-ruby like:

Completed in 1290ms (View: 152, DB: 75, Solr: 334) | 200 OK [
http://localhost:3000/search?q=nik+gene+cluster&view=2]

Has anyone done such a plug-in or extension already?

-- 
Regards,

Ian Connor

Re: Has anyone done request logging with Solr-Ruby for use in Rails?

Posted by Ian Connor <ia...@gmail.com>.
...and probably break stuff - that might be why it hasn't been done.

On Thu, Feb 11, 2010 at 1:28 PM, Mat Brown <ma...@patch.com> wrote:

> Oh - indeed - sorry, didn't read your email closely enough : )
>
> Yeah that would probably involve some pretty crufty monkey patching /
> use of globals...
>
> On Thu, Feb 11, 2010 at 13:22, Ian Connor <ia...@gmail.com> wrote:
> > This seems to allow you to log each query - which is a good start.
> >
> > I was thinking of something that would add all the ms together and report
> it
> > in the "completed at" line so you can get a higher level view of which
> > requests take the time and where.
> >
> > Ian.
> >
> > On Thu, Feb 11, 2010 at 1:13 PM, Mat Brown <ma...@patch.com> wrote:
> >
> >> On Thu, Feb 11, 2010 at 13:07, Ian Connor <ia...@gmail.com> wrote:
> >> > The idea is that in the log is currently like:
> >> >
> >> > Completed in 1290ms (View: 152, DB: 75) | 200 OK [
> >> > http://localhost:3000/search?q=nik+gene+cluster&view=2]
> >> >
> >> > I want to extend it to also track the Solr query times and time spent
> in
> >> > solr-ruby like:
> >> >
> >> > Completed in 1290ms (View: 152, DB: 75, Solr: 334) | 200 OK [
> >> > http://localhost:3000/search?q=nik+gene+cluster&view=2]
> >> >
> >> > Has anyone done such a plug-in or extension already?
> >> >
> >> > --
> >> > Regards,
> >> >
> >> > Ian Connor
> >> >
> >>
> >> Here's a module in Sunspot::Rails that does that. It's written against
> >> RSolr, which is an alternative to solr-ruby, but the concept is the
> >> same:
> >>
> >>
> http://github.com/outoftime/sunspot/blob/master/sunspot_rails/lib/sunspot/rails/solr_logging.rb
> >>
> >
> >
> >
> > --
> > Regards,
> >
> > Ian Connor
> > 1 Leighton St #723
> > Cambridge, MA 02141
> > Call Center Phone: +1 (714) 239 3875 (24 hrs)
> > Fax: +1(770) 818 5697
> > Skype: ian.connor
> >
>



-- 
Regards,

Ian Connor
1 Leighton St #723
Cambridge, MA 02141
Call Center Phone: +1 (714) 239 3875 (24 hrs)
Fax: +1(770) 818 5697
Skype: ian.connor

Re: Has anyone done request logging with Solr-Ruby for use in Rails?

Posted by Mat Brown <ma...@patch.com>.
Oh - indeed - sorry, didn't read your email closely enough : )

Yeah that would probably involve some pretty crufty monkey patching /
use of globals...

On Thu, Feb 11, 2010 at 13:22, Ian Connor <ia...@gmail.com> wrote:
> This seems to allow you to log each query - which is a good start.
>
> I was thinking of something that would add all the ms together and report it
> in the "completed at" line so you can get a higher level view of which
> requests take the time and where.
>
> Ian.
>
> On Thu, Feb 11, 2010 at 1:13 PM, Mat Brown <ma...@patch.com> wrote:
>
>> On Thu, Feb 11, 2010 at 13:07, Ian Connor <ia...@gmail.com> wrote:
>> > The idea is that in the log is currently like:
>> >
>> > Completed in 1290ms (View: 152, DB: 75) | 200 OK [
>> > http://localhost:3000/search?q=nik+gene+cluster&view=2]
>> >
>> > I want to extend it to also track the Solr query times and time spent in
>> > solr-ruby like:
>> >
>> > Completed in 1290ms (View: 152, DB: 75, Solr: 334) | 200 OK [
>> > http://localhost:3000/search?q=nik+gene+cluster&view=2]
>> >
>> > Has anyone done such a plug-in or extension already?
>> >
>> > --
>> > Regards,
>> >
>> > Ian Connor
>> >
>>
>> Here's a module in Sunspot::Rails that does that. It's written against
>> RSolr, which is an alternative to solr-ruby, but the concept is the
>> same:
>>
>> http://github.com/outoftime/sunspot/blob/master/sunspot_rails/lib/sunspot/rails/solr_logging.rb
>>
>
>
>
> --
> Regards,
>
> Ian Connor
> 1 Leighton St #723
> Cambridge, MA 02141
> Call Center Phone: +1 (714) 239 3875 (24 hrs)
> Fax: +1(770) 818 5697
> Skype: ian.connor
>

Re: Has anyone done request logging with Solr-Ruby for use in Rails?

Posted by Ian Connor <ia...@gmail.com>.
This seems to allow you to log each query - which is a good start.

I was thinking of something that would add all the ms together and report it
in the "completed at" line so you can get a higher level view of which
requests take the time and where.

Ian.

On Thu, Feb 11, 2010 at 1:13 PM, Mat Brown <ma...@patch.com> wrote:

> On Thu, Feb 11, 2010 at 13:07, Ian Connor <ia...@gmail.com> wrote:
> > The idea is that in the log is currently like:
> >
> > Completed in 1290ms (View: 152, DB: 75) | 200 OK [
> > http://localhost:3000/search?q=nik+gene+cluster&view=2]
> >
> > I want to extend it to also track the Solr query times and time spent in
> > solr-ruby like:
> >
> > Completed in 1290ms (View: 152, DB: 75, Solr: 334) | 200 OK [
> > http://localhost:3000/search?q=nik+gene+cluster&view=2]
> >
> > Has anyone done such a plug-in or extension already?
> >
> > --
> > Regards,
> >
> > Ian Connor
> >
>
> Here's a module in Sunspot::Rails that does that. It's written against
> RSolr, which is an alternative to solr-ruby, but the concept is the
> same:
>
> http://github.com/outoftime/sunspot/blob/master/sunspot_rails/lib/sunspot/rails/solr_logging.rb
>



-- 
Regards,

Ian Connor
1 Leighton St #723
Cambridge, MA 02141
Call Center Phone: +1 (714) 239 3875 (24 hrs)
Fax: +1(770) 818 5697
Skype: ian.connor

Re: Has anyone done request logging with Solr-Ruby for use in Rails?

Posted by Mat Brown <ma...@patch.com>.
On Thu, Feb 11, 2010 at 13:07, Ian Connor <ia...@gmail.com> wrote:
> The idea is that in the log is currently like:
>
> Completed in 1290ms (View: 152, DB: 75) | 200 OK [
> http://localhost:3000/search?q=nik+gene+cluster&view=2]
>
> I want to extend it to also track the Solr query times and time spent in
> solr-ruby like:
>
> Completed in 1290ms (View: 152, DB: 75, Solr: 334) | 200 OK [
> http://localhost:3000/search?q=nik+gene+cluster&view=2]
>
> Has anyone done such a plug-in or extension already?
>
> --
> Regards,
>
> Ian Connor
>

Here's a module in Sunspot::Rails that does that. It's written against
RSolr, which is an alternative to solr-ruby, but the concept is the
same:
http://github.com/outoftime/sunspot/blob/master/sunspot_rails/lib/sunspot/rails/solr_logging.rb