0

How to get exact response of a zK request

asked 2014-12-17 03:56:33 +0800

Muneeswaran gravatar image Muneeswaran
1

updated 2014-12-17 05:51:03 +0800

I have recorded ZK application using JMeter 2.12, but the same when i tried to run, JMeter not able to get the full response of a request even i have correlated dtid of that particular request.

Anyone can help.

Thanks in advance.

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2014-12-17 04:51:52 +0800

virat gravatar image virat
46 3

updated 2014-12-17 04:52:29 +0800

I thing You want this:

package com.demo;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.zkoss.zk.ui.Execution;
import org.zkoss.zk.ui.util.PerformanceMeter;

public class DemoPerformanceMeter implements PerformanceMeter {
    private static final Logger LOGGER = LoggerFactory.getLogger(DemoPerformanceMeter .class);

    private long timeStartAtClient;
    private long timeStartAtServer;
    private long timeCompleteAtServer;
    private long timeRecieveAtClient;
    private long timeCompleteAtClient;

    @Override
    public void requestCompleteAtClient(String requestId, Execution exec, long time) {
        timeCompleteAtClient = time;
    }

    @Override
    public void requestCompleteAtServer(String requestId, Execution exec, long time) {
        timeCompleteAtServer = time;
        Long serverExe = timeCompleteAtServer - timeStartAtServer;
        Long clientExe = timeCompleteAtClient - timeRecieveAtClient;
        Long networkExe = (timeCompleteAtServer - timeRecieveAtClient) + (timeStartAtServer - timeStartAtClient);
        long totalExe = 0;
        totalExe += serverExe != null ? serverExe : 0;
        totalExe += clientExe != null ? clientExe : 0;
        totalExe += networkExe != null ? networkExe : 0;
        if (exec.getAttribute("command") != null) {
            LOGGER.info("Command name:{} ",exec.getAttribute("command"));
        }
        LOGGER.info("Total browser execution time:{} milliseconds., Total server execution time:{} milliseconds., Total network execution time:{} milliseconds., Total execution time:{} milliseconds.", new Object[]{clientExe,serverExe,networkExe,totalExe});
    }

    @Override
    public void requestReceiveAtClient(String requestId, Execution exec, long time) {
        timeRecieveAtClient = time;
    }

    @Override
    public void requestStartAtClient(String requestId, Execution exec, long time) {
        timeStartAtClient = time;
    }

    @Override
    public void requestStartAtServer(String requestId, Execution exec, long time) {
        timeStartAtServer = time;
    }
}
link publish delete flag offensive edit
0

answered 2014-12-17 05:47:20 +0800

Muneeswaran gravatar image Muneeswaran
1

Hi Virat,

Thanks for your response.

You have given set of code, my doubt is, what is use of this code and where can i include this code in jmeter.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2014-12-17 03:56:33 +0800

Seen: 14 times

Last updated: Dec 17 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More