2006年01月8日

Resin的Profiler機制

Caucho的Wiki站看到新版的Resin(似乎是3.0.16開始)提供了Profiler的功能,由intrest-maillist裡看到這個功能原先是提供給Caucho的Platinum客戶使用的效能評量機制。雖然Wiki裡寫得算詳細,但類別名在3.0.17裡卻由com.caucho.profiler.ProfilerServlet改成com.caucho.tools.profiler.ProfilerServlet了(下載Source檢視後就清楚了)。

掛載Profiler的步驟可直接看Wiki,我把我測試的步驟寫在這裡備忘:
  1. 在resin.conf的某個要監測的Web應用系統裡加Servlet-mapping,以啟動Profiler機制:
          <servlet-mapping servlet-class="com.caucho.tools.profiler.ProfilerServlet" url-pattern="/resin-profiler">
            <init>
              <profiler enabled="true"/>
            </init>
            <load-on-startup/>
          </servlet-mapping>
  2. 在resin.conf的某個要監測的Web應用系統裡加上Filter,以蒐集Request資訊:
      <filter>
            <filter-name>resin-profiler</filter-name>
            <filter-class>com.caucho.tools.profiler.ProfilerFilter</filter-class>
            <init use-query="false"/>
      </filter>
      <filter-mapping filter-name="resin-profiler" url-pattern="*">
            <dispatcher>REQUEST</dispatcher>
      </filter-mapping>

然後就開始執行Web系統的一般網頁,執行一段時間後用下列URL檢視Profiling數據:
    http://localhost/myWeb/resin-profiler

網頁呈現如下:

resin profiler screenshot


基本上Profiler是把在Server上存取過的資源做了個統計,好讓開發人員分析效能。然而,因為我使用過Wily TechnologyIntroscope工具,深深覺得:Profiling也是門獨特與專精的學問,Introscope硬是比Resin的PRofiler強上太多了,一分錢一分貨真是至理名言。如果只是要簡單的Profiling功能,這個Resin Profiler應該也能發揮些功效吧。

##


Posted by emisjerry at 樂多Roodo! │21:56 │回應(0)引用(0)編程生涯
樂多分類:網路/3C 共同主題:Java/JavaScript 工具:編輯本文
Ads by Roodo! 

引用URL

http://cgi.blog.roodo.com/trackback/974085