Prev | Current Page 229 | Next

Brad Ediger

"Advanced Rails"

We will see later in the chapter how a graph
profile, though it contains a huge amount of data, can offer better insight into where
time is being spent.
Rails Analyzer Tools
The Rails Analyzer Tools are a collection of miscellaneous parts that help with performance
tuning. Two of the utilities, bench and crawl, measure ???black-box??? performance
by making rapid-fire HTTPrequests to a site. We can already do this, and
more, with httperf.
Column name Description
% Time Percentage of total time spent in only this function.
Cumulative Seconds Total number of seconds spent in this function, including time spent in functions called by
this one.
Self Seconds Total number of seconds spent in only this function, excluding time spent in functions called by
this one.
Calls Total number of calls to this function during the profiling period.
Self ms/call Average number of milliseconds spent in this function per call, excluding calls to other functions.
Total ms/call Average number of milliseconds spent in this function per call, including calls to other functions.
Name Name of the function being profiled.
Rails Optimization Example | 155
The IOTail library mixes in a tail_lines method to IO and StringIO. This method
yields once for each line that is added to an open file, as it is added. This is used in
some of the other utility methods from the Rails Analyzer Tools.
The real gem in this library, however, is rails_stat.


Pages:
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241