R
R
Roman Krylov2015-04-17 21:33:54
ruby
Roman Krylov, 2015-04-17 21:33:54

How to find out in DataMapper the time during which the SQL server processed my request?

There is a search on my site. I would like to display the time for which the server processed the search request.
If you enable logging , then in the console I will see what the SQL query was, and the time spent on its execution
DataMapper::Logger.new(STDOUT, :debug)

~ (0.251706) SELECT COUNT(*) FROM "wc_lib_items" WHERE (("id" IN (SELECT "id" FROM "wc_lib_items" ORDER BY "id" LIMIT 0) OR NOT((lower(authors) LIKE '%akatova% ' ESCAPE '|'))) AND "published" <= '2015-04-17T20:26:26+03:00')

In this case it is (0.251706)
How do I get this number from the application?
Do not parse the log)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question