标签: perf4j

您是否使用过Perf4J来收集和分析Java应用程序中的性能指标?

是否在Java应用程序中使用Perf4J来收集和分析性能统计信息?

典型模式是什么(使用日志文件,实用程序,UI,JMX等)?

您是否使用了注释和基于AOP的功能?

你有没有使用任何JMX集成?

你是如何处理生产配置的?

您是否将效果统计信息视图/报告作为应用中的功能包含在内?

请告诉您是否以及为何选择了替代图书馆/方法.

java performance aop jmx perf4j

21
推荐指数
2
解决办法
6853
查看次数

如何使用AspectJ和Tomcat配置加载时编织?

我试着用下一种方式配置加载时织入(用于使用Perf4J进行分析):

1)我添加aop.xmlMETA-INF文件夹.部署时,META-INF放置在工件根目录(即MyAppDeployed/META-INF)中.

2)我把aspectjrt-1.6.1.jar,aspectjweaver-1.6.1.jar,commons-jexl-1.1.jar,commons-logging.jarTomcat/lib文件夹(在第一次我尝试MyAppDeployed/WEB-INF/libs,但它也没有工作).

3)我-javaagent:C:\apache-tomcat-6.0.33\lib\aspectjweaver-1.6.1.jar在启动Tomcat时添加了VM选项.

4)我的aop.xml:

<!DOCTYPE aspectj PUBLIC "-//AspectJ//DTD//EN" "http://www.eclipse.org/aspectj/dtd/aspectj.dtd">

<aspectj>

    <aspects>
        <aspect name="org.perf4j.log4j.aop.TimingAspect"/>
    </aspects>

    <weaver options="-verbose -showWeaveInfo">           
        <include within="com.mypackages.MyClass"/>
    </weaver>
</aspectj>
Run Code Online (Sandbox Code Playgroud)

我没有看到任何迹象表明装载时编织发生.无论是错误报告还是必要结果.我唯一的错误信息是:

Error occurred during initialization of VM
agent library failed to init: instrument
Error opening zip file: C:\apache-tomcat-6.0.33\lib\wrong-jar.jar
Run Code Online (Sandbox Code Playgroud)

aspectjweaver-1.6.1.jar指定javaagent参数时,我在名称中输入错误的情况.如果写得正确 - 不会打印错误信息.

任何想法,我做错了什么?

PS我使用Java 5,我尝试使用1.5.4aspectj版本完全相同的结果.

java tomcat aspectj perf4j load-time-weaving

8
推荐指数
2
解决办法
2万
查看次数

perf4j @Profiled注释不起作用

我已经通过perf4J网站的以下链接,并做了同样的事情:http://perf4j.codehaus.org/devguide.html#Using_Spring_AOP_to_Integrate_Timing_Aspects

在我的spring.xml中添加了以下内容.

<aop:aspectj-autoproxy/>
<bean id="timingAspect" class="org.perf4j.log4j.aop.TimingAspect"/>
<bean id="wscClientBase" class="com.xyz.csa.core.common.WscClientBase"/>
Run Code Online (Sandbox Code Playgroud)

在类WscClientBase中,我使用@Profiled注释的以下方法.

@Profiled(tag = "SOAPCALLTEST")
public Object sendMessage(Object message) {
    String msg = message.toString();
    if (msg.indexOf(' ') > 1) {
        msg = msg.substring(1, msg.indexOf(' '));
    }
    try {
        Object ret = marshalSendAndReceive(message);
        return ret;
    } catch (RuntimeException ex) {
        throw ex;
    }
}
Run Code Online (Sandbox Code Playgroud)

我没有在应用程序日志中看到perf4j TimingLogger语句.但是,如果我使用它(如下没有注释),我会成功地看到日志语句.

public Object sendMessage(Object message) {
    String msg = message.toString();
    if (msg.indexOf(' ') > 1) {
        msg = msg.substring(1, msg.indexOf(' '));
    }
    StopWatch stopWatch …
Run Code Online (Sandbox Code Playgroud)

spring log4j seam spring-aop perf4j

7
推荐指数
1
解决办法
8616
查看次数

AspectJ的加载时间编织器如何找到META-INF\aop.xml?

我试图使用load-time-weaving将perf4j绑定到程序中,但它似乎没有在我的类路径中找到aop.xml.无论是那个还是它没有编织方面,因为它没有找到它.我已经从aop.xml启用了详细输出,但我没有看到任何编织消息,错误或其他.aspectJweaver在哪里查找META-INF/aop.xml?我怎么知道它在寻找哪一个?

我试图使用直接路径导入xml,但它没有用.-Dorg.aspectj.weaver.loadtime.configuration = C:\ dev的\主干\ BIN\META-INF\aop.xml文件

注意:程序按编程时编织工作,但我更喜欢使用load-time-weave.我还能够使用小型测试用例实现加载时编织.

aspectj perf4j

4
推荐指数
1
解决办法
5854
查看次数

如何从perf4j日志文件制作图形?

我已经使用perf4j来计算过程的性能。现在,我要为该文件制作图形。是否可以不使用Google API或任何其他可用方法来实现?

java log4j perf4j

2
推荐指数
1
解决办法
2399
查看次数

logback.xml的perf4j设置

大家好,我想知道在使用perf4j时logback.xml的确切配置设置.我在logback.xml中创建此配置

<configuration>
    <!-- Perf4J appenders -->
    <!--
       This AsyncCoalescingStatisticsAppender groups StopWatch log messages
       into GroupedTimingStatistics messages which it sends on the
       file appender defined below
    -->
    <appender name="CoalescingStatistics" class="org.perf4j.logback.AsyncCoalescingStatisticsAppender">
        <param name="TimeSlice" value="60000"/>
        <appender-ref ref="graphExecutionTimes"/>
        <appender-ref ref="graphExecutionTPS"/>
        <!-- We add the JMX Appender reference onto the CoalescingStatistics -->
        <appender-ref ref="perf4jJmxAppender"/>
    </appender>

    <appender name="graphExecutionTimes" class="org.perf4j.logback.GraphingStatisticsAppender">
        <!-- Possible GraphTypes are Mean, Min, Max, StdDev, Count and TPS -->
        <param name="GraphType" value="Mean"/>
        <!-- The tags of the timed execution blocks to graph are specified …
Run Code Online (Sandbox Code Playgroud)

java testing performance unit-testing perf4j

2
推荐指数
1
解决办法
9821
查看次数