简体   繁体   English

ZK性能监视器

[英]A ZK Performance Monitor

We have requirement to monitoring performance in our application .I found the link A ZK Performance Monitor but i am unable to configure this.Actually i want to configure performance monitoring in my application with slf4j logger .Anyone can share steps to configure for the same.( zk 7.0.1) 我们需要在应用程序中监视性能。我找到了一个ZK性能监视器链接,但我无法对其进行配置。实际上我想在我的应用程序中使用slf4j logger来配置性能监视。任何人都可以共享相同的配置步骤。 (zk 7.0.1)

I am trying to create the CommandPhaseListener for this case .But i am not sure where we implements the CommandPhaseListener class in our application to track performance .Actually we want to monitoring the performance in slf4j logger. 我正在尝试为这种情况创建CommandPhaseListener ,但是我不确定在应用程序中在哪里实现CommandPhaseListener类以跟踪性能。实际上,我们想在slf4j记录器中监视性能。

package support.mvvm;

import org.zkoss.bind.*;
import org.zkoss.zk.ui.Executions;

public class CommandPhaseListener implements PhaseListener {

    @Override
    public void prePhase(Phase phase, BindContext ctx) {
        if (phase== Phase.COMMAND){
            Executions.getCurrent().setAttribute("command", ctx.getCommandName());
            System.out.println(ctx.getCommandName());
        }
    }

    @Override
    public void postPhase(Phase phase, BindContext ctx) {

    }

}

Thanks 谢谢

I'm guessing you didn't registered the listener in zk.xml: 我猜您没有在zk.xml中注册侦听器:

<zk>
    <library-property>
        <name>org.zkoss.bind.PhaseListener.class</name>
        <value>support.mvvm.CommandPhaseListener</value>
    </library-property>
</zk>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM