Git Product home page Git Product logo

profiler's Introduction

Profiler

java实现的一个简单的方法级别的耗时监控工具,可以监控每个方法的运行时间和相对堆栈上层的耗时比例

v1.0.0

支持多用统计格式,毫秒,纳秒等

完整配置:

<bean id="aopSupportBean2" class="com.liusoft.tools.test.AOPSupportBean"/>   <!--要监控哪个Bean-->
<bean id="profilerNanos" class="com.liusoft.tools.profiler.AOPSupport.ProfilerSpringAOPSupport">
    <property name="monitorMethod">
        <map>
            <entry key="aopSupportBean2">
                <value>test1,test2,test3</value>   <!--声明  aopSupportBean 的 test,1,2,3方法加入监控-->
            </entry>
        </map>
    </property>
    <property name="timeUnit" value="MILLISECONDS"/> <!--指定统计单位可选 NANOSECONDS, MICROSECONDS, MILLISECONDS, SECONDS, MINUTES, HOURS, DAYS -->
</bean>

-----------------------------------------------------------分割线-------------------------------------------------------------------------

第三版,引入cglib实现对监控方法的透明织入

使用方式:

<!--声明  aopSupportBean 的 test,1,2,3方法加入监控-->
 <bean id="profilerSpringAOPSupport" class="com.liusoft.tools.profiler.AOPSupport.ProfilerSpringAOPSupport">
      <property name="monitorMethod">
          <map>
              <entry key="aopSupportBean">
                  <value>test1,test2,test3</value>
              </entry>
          </map>
      </property>
  </bean>
<!-- 测试bean : 普通的一个bean而已  -->
<bean id="aopSupportBean" class="com.liusoft.tools.test.AOPSupportBean"/>

详见单元测试

                                                                      2013-11-15日

增加时间单位配置ProfilerSpringAOPSupport 增加时间单位配置项 可通过 property name="timeUnit" value="NANOSECONDS" 指定监控时间单位

profiler's People

Contributors

liuinsect avatar

Stargazers

oxygen bin avatar  avatar Joe avatar  avatar 龙哥 avatar 阿凯 avatar 0xC000005 avatar weep avatar  avatar AZ avatar  avatar  avatar  avatar 5452 avatar  avatar  avatar  avatar

Watchers

James Cloos avatar  avatar weep avatar  avatar  avatar 阿凯 avatar  avatar

profiler's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.