調用超時監(jiān)控組件( https://github.com/2-dfire/twodfire-monitor )
這是我公司內部使用的超時監(jiān)控組件,現在開源出來。對于中小型企業(yè)來說,已經完全滿足了。
介紹
當某個action或接口執(zhí)行超過設定閾值時將把調用棧的各個步驟開銷打印出來。
使用
- 你可以直接下載源碼或者直接使用jar (https://github.com/2-dfire/twodfire-monitor/releases/tag/1.0 )
- 配置文件(具體表達式自己根據項目需要配置)
<bean id="monitorAround" class="com.twodfire.timerMonitor.monitor.MonitorAround">
<property name="maxTime" value="300"/><!-- 最大的超時時間-->
</bean>
<aop:config>
<aop:aspect id="testAspect" ref="monitorAround">
<aop:pointcut id="timeMonitorPointcut" expression="execution(* *..service*..*(..))"/>
<aop:around pointcut-ref="timeMonitorPointcut" method="watchPerformance"/>
</aop:aspect>
</aop:config>
示例
https://github.com/edagarli/monitor-example/
contact me
Weibo: @edagarli