Prev | Current Page 350 | Next

Kevin Marshall, Chad Pytel, and Jon Yurek

"Pro Active Record: Databases with Ruby and Rails"

We will,
however, leave those decisions and the details of that work for you to investigate as you see fit.
Our logging example is admittedly very simplistic. There is a lot more you can, and
probably should, do with logging when it comes to debugging and tuning your Active Record
applications. The logging features inherited from Ruby??™s Logger class provide a number of
additional settings and methods that are outside of the scope of this book.
For example, we simply used the Active Record default logging level of Logger::DEBUG for
our examples, which shows you lots of useful information about your queries and other activities.
There are a number of other log levels that you can work through as you hit different stages
and focus on different parts of your overall testing process.
For more information on Ruby logging, you should visit http://www.ruby-doc.org/core/
classes/Logger.html.
CHAPTER 6 ?–  ACTIVE RECORD TESTING AND DEBUGGING 158
Active Record Benchmarking
The final tip we need to mention when debugging and tuning your Active Record applications
is the idea of benchmarking.


Pages:
338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362