通过 Jmeter 从 Phantomjs 收集客户端性能指标 [英] Collecting client side Performance Metrics from Phantomjs through Jmeter

查看:18
本文介绍了通过 Jmeter 从 Phantomjs 收集客户端性能指标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在整个PhantonJS Driver Config中,我们有没有什么办法可以通过phantomjs通过使用Jmeter DomLoad windLoad ResourceCount Resource size来捕获以下客户端性能指标.

谢谢

解决方案

我建议使用允许执行任意 JavaScript 代码的 WDS.browser.executeScript() 方法捕获指标.完成后,您可以直接将有趣"的值存储到 JMeter 变量中以备后用.

以下是使用

请参阅 WebDriver 采样器:您最关心的 10 个问题已回答 WebDriver Sampler 提示和技巧指南

Throughout PhantonJS Driver Config is there any way we can capture the following client-side performance metrics through phantomjs by using Jmeter DomLoad windLoad ResourceCount Resource size.

Thanks

解决方案

I would recommend capturing the metrics using WDS.browser.executeScript() method which allows executing arbitrary JavaScript code. Once done you can directly store "interesting" values into JMeter Variables for later use.

Here is an example of using Navigation API to get extended information on page loading:

WDS.sampleResult.sampleStart()
WDS.browser.get('http://jmeter-plugins.org')
var timings = WDS.browser.executeScript('var performance = window.performance || window.webkitPerformance || window.mozPerformance || window.msPerformance || {}; var timings = performance.timing || {}; return timings;');
WDS.log.info(timings)
WDS.sampleResult.sampleEnd()

See The WebDriver Sampler: Your Top 10 Questions Answered guide for WebDriver Sampler tips and tricks

这篇关于通过 Jmeter 从 Phantomjs 收集客户端性能指标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆