dimanche 3 janvier 2016

Rack MiniProfiler not capturing sql queries in My Rails app

In our Project we have a lot of ActiveRecord models, we use Postgres as our DB Server and also MongoDB with mongoid 2.2 gem. I need to improve/optimize our project to reduce the number of SQL queries being executed I chose rack-mini-profiler gem to profile my app for SQL queries. initially I did

gem "rack-mini-profiler"

but didn't work giving the following error

uninitialized constant Mongo::Server (NameError)

then I just fixed the version to 0.9.7 and it worked without any problem, but the sql queries in log were Zero to Minimal. The queries I am trying to profile are of Postgres and I can see them in the my terminal, but not in miniprofiler on my view page.

only when user sign_ins/sign_outs the update query shows up some times and nothing else shows up.

I also tried ?pp=full-backtrace with no use.

I also have caching enabled via Dalli gem and memcached and I also tried setting miniprofiler store to MemStore.

miniprofiler log

  • Ruby: 1.9.3p550
  • Rails: 3.1.10
  • pg: 0.11.0
  • mongoid: 2.2
  • OS: Ubuntu 14.04 x86_64

Aucun commentaire:

Enregistrer un commentaire