• 性能测试计划
  • 性能测试用例
  • 录制脚本
  • 性能测试结果
  • 性能测试报告
  • 性能测试监控报告

准备工作

  1. 从脚本已录制成功之后开始进行压测
  2. 安装Jmeter拓展插件 查看 Transactions per Second https://jmeter-plugins.org/wiki/TransactionsPerSecond/       ←插件地址
  3. 在压测前先安装 Nmon监控工具在服务器linux性能监控分析及通过nmon_analyse生成分析报表
 

PS :安装 TPS教程

解压安装

将 jpgc-graphs-basic-2.0.zip 解压缩后只有一个 lib 目录,该目录下有一个 ext 文件夹和一个 jmeter-plugins-cmn-jmeter-0.3.jar 包,ext 文件夹中有 jmeter-plugins-graphs-basic-2.0.jar 和 jmeter-plugins-manager-0.10.jar 包。
将 lib 目录下的 jmeter-plugins-cmn-jmeter-0.3.jar 拷贝到 %JMeter%/lib 目录下,将 ext 目录下的 jmeter-plugins-graphs-basic-2.0.jar 和 jmeter-plugins-manager-0.10.jar 拷贝到 %JMeter%/lib/ext 目录下,重启 JMeter,发现已经支持 TPS、TRT 等视图了:

TPS导入解析测试报告

导入之后就可以看到 TPS数据了

取至Jmeter官方文档

1.0.2 Load Test running

Once your Test Plan is ready, you can start your Load Test. The first step is to configure the injectors that will run JMeter, this as for any other Load Testing tool includes:

  • Correct machine sizing in terms of CPU, memory and network
  • OS Tuning
  • Java setup: Ensure you install the latest version of Java supported by JMeter
  • Correct sizing of Java Heap. By default JMeter runs with a heap of 512MB, this might not be enough for your test and depends on your test plan and number of threads you want to run

Once everything is ready, you will use Command-line mode (called Non-GUI mode) to run it for the Load Test.

 
Don't run load test using GUI mode !   

不要使用GUI模式运行负载测试!因为GUI模式的话会占用比较大的内存空间,并发数量上不去等等的问题

Using Non-GUI mode, you can generate a CSV (or XML) file containing results and have JMeter generate an HTML report at end of Load Test. JMeter will by default provide a summary of load test while it's running.

You can also have real-time results during your test using Backend Listener.

NON-GUI模式允许得到结果后可以在后端监听器的测试期间获得实时结果。这句话如何理解呢,见上面“TPS导入解析测试报告

Running JMeter

To run Apache JMeter in NON_GUI

直接进入脚本路径,输入 Jmeter的启动路径

可以查看到Jmeter的相关命令帮助

小七的Jmeter路径是安装在D:\Jmeter\jmeter-3.1  所以直接进入bin目录下 找到jmeter  查看H帮助文档

C:\Users\lamw\Desktop\lamw
λ D:\Jmeter\jmeter-3.1\bin\jmeter -h
Writing log file to: C:\Users\lamw\Desktop\lamw\jmeter.log

    _    ____   _    ____ _   _ _____       _ __  __ _____ _____ _____ ____
/ \ | _ \ / \ / ___| | | | ____| | | \/ | ____|_ _| ____| _ \
/ _ \ | |_) / _ \| | | |_| | _| _ | | |\/| | _| | | | _| | |_) |
/ ___ \| __/ ___ \ |___| _ | |___ | |_| | | | | |___ | | | |___| _ <
/_/ \_\_| /_/ \_\____|_| |_|_____| \___/|_| |_|_____| |_| |_____|_| \_\ 3.1 r1770033

Copyright (c) 1999-2016 The Apache Software Foundation

To list all command line options, open a command prompt and type:

jmeter.bat(Windows)/jmeter.sh(Linux) -?

--------------------------------------------------

To run Apache JMeter in GUI mode, open a command prompt and type:

jmeter.bat(Windows)/jmeter.sh(Linux) [-p property-file]

--------------------------------------------------

To run Apache JMeter in NON_GUI mode:
Open a command prompt (or Unix shell) and type:

jmeter.bat(Windows)/jmeter.sh(Linux) -n -t test-file [-p property-file] [-l results-file] [-j log-file]

--------------------------------------------------

To run Apache JMeter in NON_GUI mode and generate a report at end :
Open a command prompt (or Unix shell) and type:

jmeter.bat(Windows)/jmeter.sh(Linux) -n -t test-file [-p property-file] [-l results-file] [-j log-file] -e -o [Path to o
utput folder]

--------------------------------------------------
To generate a Report from existing CSV file:
Open a command prompt (or Unix shell) and type:

jmeter.bat(Windows)/jmeter.sh(Linux) -g [csv results file] -o [path to output folder (empty or not existing)]

--------------------------------------------------

To tell Apache JMeter to use a proxy server:
Open a command prompt and type:

jmeter.bat(Windows)/jmeter.sh(Linux) -H [your.proxy.server] -P [your proxy server port]

---------------------------------------------------

To run Apache JMeter in server mode:
Open a command prompt and type:

jmeter-server.bat(Windows)/jmeter-server(Linux)

---------------------------------------------------

上面包含了一些参数 可以输入 -l  查看

C:\Users\lamw\Desktop\lamw
λ D:\Jmeter\jmeter-3.1\bin\jmeter -l
Usage
--?
print command line options and exit
-h, --help
print usage information and exit
-v, --version
print the version information and exit
-p, --propfile <argument>
the jmeter property file to use
-q, --addprop <argument>
additional JMeter property file(s)
-t, --testfile <argument>
the jmeter test(.jmx) file to run
-l, --logfile <argument>
the file to log samples to
-j, --jmeterlogfile <argument>
jmeter run log file (jmeter.log)
-n, --nongui
run JMeter in nongui mode
-s, --server
run the JMeter server
-H, --proxyHost <argument>
Set a proxy server for JMeter to use
-P, --proxyPort <argument>
Set proxy server port for JMeter to use
-N, --nonProxyHosts <argument>
Set nonproxy host list (e.g. *.apache.org|localhost)
-u, --username <argument>
Set username for proxy server that JMeter is to use
-a, --password <argument>
Set password for proxy server that JMeter is to use
-J, --jmeterproperty <argument>=<value>
Define additional JMeter properties
-G, --globalproperty <argument>=<value>
Define Global properties (sent to servers)
e.g. -Gport=123
or -Gglobal.properties
-D, --systemproperty <argument>=<value>
Define additional system properties
-S, --systemPropertyFile <argument>
additional system property file(s)
-L, --loglevel <argument>=<value>
[category=]level e.g. jorphan=INFO or jmeter.util=DEBUG
-r, --runremote
Start remote servers (as defined in remote_hosts)
-R, --remotestart <argument>
Start these remote servers (overrides remote_hosts)
-d, --homedir <argument>
the jmeter home directory to use
-X, --remoteexit
Exit the remote servers at end of test (non-GUI)
-g, --reportonly <argument>
generate report dashboard only, from a test results file
-e, --reportatendofloadtests
generate report dashboard after load test
-o, --reportoutputfolder <argument>
output folder for report dashboard

下面我们就采用 NON_GUI模式执行脚本 如下:

--------------------------------------------------

To run Apache JMeter in NON_GUI mode and generate a report at end :
Open a command prompt (or Unix shell) and type: jmeter.bat(Windows)/jmeter.sh(Linux) -n -t test-file [-p property-file] [-l results-file] [-j log-file] -e -o [Path to o
utput folder] --------------------------------------------------
输入以下命令直接执行录制好的脚本文件

C:\Users\lamw\Desktop\lamw
λ D:\Jmeter\jmeter-3.1\bin\jmeter.bat -n -t test.jmx -l test_report_01.csv -e -o test_report_01 命令解析:
C:\Users\lamw\Desktop\lamw  这个是测试脚本所在的文件目录 

 
 
D:\Jmeter\jmeter-3.1\bin\jmeter.bat    --------Jmeter.bat 的执行路径

-n, --nongui -------------以nongui模式执行
run JMeter in nongui mode

-t, --testfile <argument>-------------压测脚本文件jmx
the jmeter test(.jmx) file to run

-l, --logfile <argument>-------------将样本记录到的文件
the file to log samples to

-e, --reportatendofloadtests------------ 在加载测试后生成报告仪表板
generate report dashboard after load test
-o, --reportoutputfolder <argument>---------------- 报告仪表板的输出文件夹
output folder for report dashboard


运行脚本进行压测

当然,在运行脚本进行压测的时候 需要在服务器 先执行 采集命令

ps -ef | grep nmon 查看采集数据的进程

[root@lamw /home/lam7/nmon]# ps -ef | grep nmon

[root@lamw /home/lam7/nmon]# nmon -f -s 1 -c 60

-f 表示生成的数据文件名中有时间;

-t 输出中包括占用率较高的进程;

-s 1 表示每 1 秒采集一次数据;

-c 60 表示采集 60 次,1s*60=60秒;

至于监控的方式可以查看上面所讲的准备工作第三点

Jmeter之http性能测试实战 非GUI模式压测 NON-GUI模式 结果解析TPS——干货(十一)的更多相关文章

  1. Jmeter(一)非GUI模式压测(NON-GUI模式)结果解析TPS

    非GUI模式压测(NON-GUI模式)结果解析TPS 准备工作 从脚本已录制成功之后开始进行压测 安装Jmeter拓展插件 查看 Transactions per Second https://jme ...

  2. Jmeter之http性能测试实战 NON-GUI模式 进行分布式压力测试——干货(十二)

    Apache JMeter Distributed Testing Step-by-step This short tutorial explains how to use multiple syst ...

  3. JMeter-命令行模式压测

    前言 使用非GUI模式,即命令行模式运行jmeter测试脚本能够大大缩减系统资源,今天跟小伙伴们讲一下JMeter如何在命令行模式进行压测吧! 一:配置好JDK和JMeter的环境变量(过程略) 二: ...

  4. Jmeter之TCP取样器(模拟数据上报压测)

    TCP压测 场景:模拟硬件设备上报数据(登录,心跳,GPS定位数据/光感数据/电量数据),对这个功能进行压测 啰嗦一句:TCP压测很简单,只要调通了一个TCP,后续的逻辑判断就用逻辑控制器和正则处理就 ...

  5. SwingBench 字符模式压测最佳实践

    之前写过<使用SwingBench 对Oracle RAC DB性能 压力测试>,使用的是最基础直观的图形模式,已经可以满足大多数需求. 但是在有些场景下,图形模式可能本身消耗资源过大,尤 ...

  6. my31_MGR单写模式压测以及对比普通从库记录

    场景MGR单写模式三节点,db46写节点,db47/db48为读节点工具sysbencn.压测15个小时,db46上18线程纯写,12线程oltp混合测试,db48上12线程select在压测2个小时 ...

  7. jmeter+nmon+crontab简单的执行接口定时压测

    一.概述 临时接到任务要对系统的接口进行压测,上面的要求就是:压测,并发2000 在不熟悉系统的情况下,按目前的需求,需要做的步骤: 需要有接口脚本 需要能监控系统性能 需要能定时执行脚本 二.观察 ...

  8. jmeter之登录接口的一次简单压测与分析

    前言:登录接口的一次简单压测与分析 1.接口文档 2.配置元件 3.结果分析 1.接口文档 a.拿到接口文档 接口地址:http://localhost:8080/jpress/admin/login ...

  9. Jmeter系列(12)- 上传接口压测

    step-1上传接口分析 上传接口源码分析:分析上传文件类型.有无大小限制.存放上传文件服务器 没有源码通过抓包工具,或者Chrome查看框架源代码 接口路径/uploadfile,接口请求POST, ...

随机推荐

  1. 变量、交互&注释、数字&字符串&布尔、格式化输出

    变量 变量定义规范: 声明变量: name = "Neo Zheng"    # name为变量名(标识符),"Neo Zheng"是变量值. 变量定义规则: ...

  2. [51nod1329]路径游戏

    Snuke与Sothe两个人在玩一个游戏.游戏在一个2*N的网格中进行(2行N列),这个网格中的2N个格子不是黑色就是白色.定义,一条有效路径是指一个完全由白色格子构成的序列,这个序列的第一个网格元素 ...

  3. Hbuilder实用技巧

    转自:http://blog.csdn.net/qq_34099161/article/details/51451712 1. Q:怎么实现代码追踪? A:在编辑代码时经常会出现需要跳转到引用文件或者 ...

  4. 除了四大传统OA软件商,国内还有这些优秀的OA协同产品

    国内OA 软件市场经过多年的发展,在产品.应用.服务方面都已相对成熟,也出现了众多优秀的OA软件品牌. 据中国软件协会2017年公布的数据显示:泛微OA.致远OA.华天动力OA.蓝凌OA的销售仍稳居O ...

  5. 微信小程序 登录流程规范解读

    一. 官方登录时序图 二. 简单理解 这里仅按照官方推荐的规范来 0. 前置条件 一共有三端: - 微信小程序客户端 - 第三方服务器端(自己搭建) - 微信服务器端 1. 客户端获得code,并将c ...

  6. html5只需要<!DOCTYPE HTML>的原因

    首先我们先了解两个东西: SGML:标准通用标记语言(以下简称"通用标言"),是一种定义电子文档结构和描述其内容的国际标准语言:[1]  通用标言为语法置标提供了异常强大的工具,同 ...

  7. 【深度学习系列】CNN模型的可视化

    前面几篇文章讲到了卷积神经网络CNN,但是对于它在每一层提取到的特征以及训练的过程可能还是不太明白,所以这节主要通过模型的可视化来神经网络在每一层中是如何训练的.我们知道,神经网络本身包含了一系列特征 ...

  8. UE4 unreliable 同步问题

    今天发现了一个问题,标记为unreliable的函数从来不执行,但是官方文档上的说明是只有在网络负载重时才不执行此类函数,哎哎哎.

  9. 浏览器与CDN缓存行为

    @地址栏回车 1. 未过期: 浏览器拦截,直接返回: (expires/cache-control两个参数决定,如果两个参数都有,cache-control覆盖expires); 2. 已过期: et ...

  10. ThinkPHP3.2基础知识(三)

    1.如何开启调试模式,开启调试模式有什么用处? // 开启调试模式 建议开发阶段开启 部署阶段注释或者设为false define('APP_DEBUG',True); 开启调试模式的用处:方便及时发 ...