首页 > 系统相关 >centos7 安装jq并获取meanResTime和throughput

centos7 安装jq并获取meanResTime和throughput

时间:2022-09-21 16:55:36浏览次数:64  
标签:1.0 meanResTime 0.0 jq centos7 7.0 throughput

用jmeter性能测试之后会产生很多jtl,statistic文件,为了方便做excel表,需要自动读出吞吐率和平均响应时间。

1. 添加epel源

yum install wget
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh epel-release-latest-7.noarch.rpm
yum repolist

2. 安装jq

yum install jq

3. 使用

使用命令如下

jq '.query[0].meanResTime' statistics.json #如果多个query,不知道jmeter中是否允许
jq '.query.meanResTime' statistics.json
jq '.query.throughput' statistics.json

产生的json格式的结果文件如下

{
  "Total" : {
    "transaction" : "Total",
    "sampleCount" : 360001,
    "errorCount" : 360000,
    "errorPct" : 99.999725,
    "meanResTime" : 0.22442993213907703,
    "medianResTime" : 0.0,
    "minResTime" : 0.0,
    "maxResTime" : 246.0,
    "pct1ResTime" : 1.0,
    "pct2ResTime" : 1.0,
    "pct3ResTime" : 1.0,
    "throughput" : 11237.389187164441,
    "receivedKBytesPerSec" : 460.9072605818454,
    "sentKBytesPerSec" : 0.0
  },
  "query" : {
    "transaction" : "prepare select statement with parameter",
    "sampleCount" : 360000,
    "errorCount" : 360000,
    "errorPct" : 100.0,
    "meanResTime" : 0.22441111111111164,
    "medianResTime" : 0.0,
    "minResTime" : 0.0,
    "maxResTime" : 246.0,
    "pct1ResTime" : 1.0,
    "pct2ResTime" : 1.0,
    "pct3ResTime" : 1.0,
    "throughput" : 11288.451287197015,
    "receivedKBytesPerSec" : 463.0028848264401,
    "sentKBytesPerSec" : 0.0
  },
  "get current time" : {
    "transaction" : "get current time",
    "sampleCount" : 1,
    "errorCount" : 0,
    "errorPct" : 0.0,
    "meanResTime" : 7.0,
    "medianResTime" : 7.0,
    "minResTime" : 7.0,
    "maxResTime" : 7.0,
    "pct1ResTime" : 7.0,
    "pct2ResTime" : 7.0,
    "pct3ResTime" : 7.0,
    "throughput" : 142.85714285714286,
    "receivedKBytesPerSec" : 0.0,
    "sentKBytesPerSec" : 0.0
  }
}

  

 

标签:1.0,meanResTime,0.0,jq,centos7,7.0,throughput
From: https://www.cnblogs.com/panda4671/p/16716219.html

相关文章

  • 第二章 Centos7下安装Docker-20.10.2
    一、查看系统内核版本号1.查看系统内核版本号[root@m01~]#uname-aLinuxm013.10.0-957.el7.x86_64#1SMPThuNov823:39:32UTC2018x86_64x86_64x86_64GNU/......
  • centos7防火墙配置
    开放端口的方法:方法一:命令行方式开放端口命令:/sbin/iptables-IINPUT-ptcp--dport8080-jACCEPT保存:/etc/rc.d/init.d/iptablessave重启服务:/etc/init.d/iptables......
  • linux 升级centos7版本
    目录linux升级centos7版本查看系统版本更换国内源验证linux升级centos7版本我这里从centos7.*升级到centos7.9查看系统版本[root@centos7-2~]#cat/etc/redhat-rel......
  • jquery动态为select 绑定数据
      functiongetChapters(courseid){$.ajax({url:'/chapter/getChapersByUidCourseID?courseID='+courseid,su......
  • Centos7——防火墙(Firewall)命令
    Centos7默认安装了firewalld,如果没有安装的话,则需要YUM命令安装;firewalld真的用不习惯,与之前的iptable防火墙区别太大。安装Firewall命令:yuminstallfirewalldfirewall......
  • centos7 中 利用conda安装delly软件
     001、(base)[liujiaxin01@PC1home]$cat/etc/redhat-releaseCentOSLinuxrelease7.6.1810(Core)##系统版本(base)[liujiaxi......
  • centos7 中 使用conda安装 Pindel 软件
     001、[root@PC1software]#cat/etc/redhat-release##系统版本CentOSLinuxrelease7.6.1810(Core)[root@PC1software]#conda--version......
  • centos7 中如何安装anaconda
     001、查看系统[root@PC1software]#cat/etc/redhat-releaseCentOSLinuxrelease7.6.1810(Core) 002、下载anaconda安装包:wgethttps://mirrors.tuna.tsin......
  • centos7镜像部署的php-fpm的9000端口无法被外部访问
    问题:用docker部署了源码安装的php,想试试让外部访问9000端口,发现无法访问,在宿主机telnetdocker的ip9000也是无法访问的解决办法:修改php的php-fpm.conf原来listen=......
  • 虚拟机中的CentOS7安装Nginx后本机无法访问的解决办法 开放端口的方法如下
    虚拟机中的CentOS7安装Nginx后本机无法访问的解决办法,VMware虚拟机中的CentOS7安装Nginx后本机无法访问的解决办法在虚拟机centos7上安装nginx之后虚拟机内能访问,真......