At top monitor window displays the status of ongoing Rails request URL

sponsored links
http://robbin.javaeye.com/blog/283992

This is from a PragDave's blog Above to learn skills, very useful, very cool!

Saying in a Rails site running the above, we can use Linux's top command to monitor the Rails application instances running condition, occupied by memory, the CPU consumption and so on, for example, a moment JavaEye site screenshot:

At top monitor window displays the status of ongoing Rails request URL


In this screenshot inside, we can know the process of Rails instances running state, but we can not know the exact, a current consumption of CPU time high exactly fcgi process the request in the implementation of which, if this be able to know exact information, the search performance bottlenecks have great help, so we look to change the following months the Magic:

At your Rails application's app / controllers / application.rb inside two additional filter, as follows:

Ruby code

  1. before_filter: set_process_name_from_request
  2. after_filter: unset_process_name_from_request
  3. def set_process_name_from_request
  4. $ 0 = request.path [0,16]
  5. end
  6. def unset_process_name_from_request
  7. $ 0 = request.path [0,15] + "*"
  8. end

before_filter :set_process_name_from_request
after_filter :unset_process_name_from_request

def set_process_name_from_request
  $0 = request.path[0,16] 
end   

def unset_process_name_from_request
  $0 = request.path[0,15] + "*"
end  


Ruby language at $ 0 is the command-line applications, because we fcgi way to start Rails, so the default display for dispatch.fcgi, but we are now to change the $ 0, put URI forced assignment to $ 0, then top will be deceived us :

Come give me show me the current handling of the request URI is / blog/283416, in fact, this is my blog: The domain model implementation of the concluding point of view.

Are not cool! Rails application if the request is being processed, then the top display / blog/283416, if the Rails application has processed the request, then the top display / blog/283416 *, then a full point, and give everyone had fun

At top monitor window displays the status of ongoing Rails request URL
  • del.icio.us
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb

Related Posts of At top monitor window displays the status of ongoing Rails request URL

  • Topic: Shoes - Construction Ruby client gadget

    http://www.javaeye.com/topic/295829 Shoes Ruby are cross-platform GUI applications, recently released a new version, it is a very interesting Ruby GUI client, the following are some characteristics of Introduction: 1. Cross-platform support for windo ...

  • Rails project to upgrade to 2.2.2 there is a problem

    System starts out abnormal information: Exiting / var/lib/gems/1.8/gems/rails-2.2.2/lib/initializer.rb: 530: in `send ': undefined method` cache_template_extensions =' for ActionView:: Base: Class (NoMethodError) from / var/lib/gems/1.8/gems/ ...

  • in `require ': no such file to load - date / format

    Learn today ruby, the ruby download and install, and then began to refer to the relevant entry-tutorial section of a small process running directly on the command line: ruby-e "print 'hello, yiditushe'", after the carriage return, prompt

  • Hibernate performance tuning (the focus of understanding)

    1. Object Cache: fine-grained, in view of the table Record Level, transparent access, without changing the procedure code can greatly enhance the performance of web applications. ORM object cache is a magic weapon for the victory. 2. The merits of th ...

  • Ruby Symbol

    Ruby is a completely cross-platform object-oriented scripting language, built on the Ruby-based Web framework Ruby on Rails (ROR) is the field of web development is gaining increasing acceptance. ROR substantial use of the Ruby language features, Symbol i

  • Ruby Design Pattern

    Ruby Design Pattern This book is about a focus on aspects of design patterns book. This book user-friendly way to introduce the Ruby design patterns, including an overview of Ruby, the use of Template Method Transform algorithm, using the strategy of repl

  • Pyronaridine listing! Ruby programming language

    Interactive Net Purchase Excellence Amazon purchase [Original title] The Ruby Programming Language Publishing ] [ O'Reilly Media, Inc. [Author] (United States) David Flanagan; Yukihiro Matsumoto Translator [] LIAO Zhi-gang; Zhang Wo [Name] Books O

  • Shoes - Construction Ruby client gadget

    Shoes Ruby are cross-platform GUI applications, recently released a new version, it is a very interesting Ruby GUI client, the following are some characteristics of Introduction: 1. Cross-platform support for windows / linux / mac os 2. Very small, t ...

  • hibernate load delay

    Lazy loading: Lazy loading mechanism is in order to avoid unnecessary performance overhead and put forward the so-called lazy loading is required when the real data at a time when the real implementation of the data load operation. At Hibernate provides f

  • FLEX: integrating Spring + Hibernate

    Before a friend also wanted to study development of FLEX. Asked me to help him to be a small sample. Spent a weekend time, to integrate a sampleproject. Client: FLEX Server: Spring2.5 + Hibernate3.2 + Hibernate-annotations3.3.1 + MySQL5 FDS: BlazeDS3 IDE:

blog comments powered by Disqus
Recent
Recent Entries
Tag Cloud
Random Entries