ruby on rails - Get altering queries in Mongoid -


I have a large test suite that, after each trial, restores the entire Mongodabi database, which acts as a rail fixtures Does this suite include tests for too much reading, so I am unnecessarily reinstalling and it eats performance, marking these tests will work in some way, but I have to forget it and it is too much So helpful, however, if some shuffle has been done, then a very fast exposure can be increased by running the restoration process (Mongodamp and Mongorastore). So my question is:

Is there any way to get all the (shuffle) stinging questions (or at least counting), which were done from a particular time? Perhaps from the log, perhaps there is some internal counter in Monogoid ...

Mongo DB order Server Status returned the number of operations, so I can easily hook them:

class ActiveSupport :: TestCase @opcounters = opcounters end teardown if opcounters! = @opcounters System "mongorestore --drop # {file.expand_path ('../tmp', __FILE__)} & gt; / dev / null 2 ​​& gt; and 1 end-end private def opacitors Mongoid :: Session.default.command (serverStatus: 1). Fetch ('opcounters'). Piece ('insert', 'update', 'deleted') end end

btw Performance increased by more than 50%.


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -