jmeter實時結果

實時結果

從Jmeter2.13開始,可以通過提供一個實現AbstractBackendListenerClient的類,將實時結果通過Backend Listener發送到後端
- GraphiteBackendListenerClient,允許將指標發送到Graphite後端
- JMeter 3.2中引入的InfluxDBBackendListenerClient允許使用UDP或HTTP協議將指標發送到InfluxDB後端

暴露的度量標準

線程/虛擬用戶度量標準

指標 描述
<rootMetricsPrefix>test.minAT 最小活動線程
<rootMetricsPrefix>test.maxAT 最大活動線程
<rootMetricsPrefix>test.meanAT 平均活動線程
<rootMetricsPrefix>test.startedT 開始線程
<rootMetricsPrefix>test.endedT 完成的線程

響應時間度量

在此的採樣器都是【指定名稱的採樣器】

指標 描述
<rootMetricsPrefix><samplerName>.ok.count 稱採樣器響應成功的總數
<rootMetricsPrefix><samplerName>.h.count 服務器每秒點擊次數,此度量標準累積樣本結果和子結果(如果使用事務控制器,則應取消選中”Generate parent sampler”)
<rootMetricsPrefix><samplerName>.ok.min 採樣器成功響應的最短響應時間
<rootMetricsPrefix><samplerName>.ok.max 採樣器成功響應的最長響應時間
<rootMetricsPrefix><samplerName>.ok.avg 採樣器成功響應的平均響應時間
<rootMetricsPrefix><samplerName>.ok.pct<percentileValue> 針對採樣器名稱的成功響應計算百分比。每個值將有一個度量標準,backend listener的默認百分位數設置爲“90; 95; 99”,即3百分位數爲90%,95%和99%
<rootMetricsPrefix><samplerName>.ko.count 採樣器響應失敗的總數
<rootMetricsPrefix><samplerName>.ko.min 採樣器響應失敗的最短響應時間
<rootMetricsPrefix><samplerName>.ko.max 採樣器響應失敗的最長響應時間
<rootMetricsPrefix><samplerName>.ko.avg 採樣器響應失敗的平均響應時間
<rootMetricsPrefix><samplerName>.ko.pct<percentileValue> 針對採樣器名稱的失敗響應計算百分位數。每個計算值將有一個度量標準,backend listener的默認百分位數設置爲“90; 95; 99”,即3百分位數爲90%,95%和99%
<rootMetricsPrefix><samplerName>.a.count 採樣器的響應數(ok.count和ko.count的總和)
<rootMetricsPrefix><samplerName>.a.min 採樣器響應的最小響應時間(ok.count和ko.count的最小值)
<rootMetricsPrefix><samplerName>.a.max 採樣器響應的最大響應時間(ok.count和ko.count的最大值)
<rootMetricsPrefix><samplerName>.a.avg 採樣器響應的平均響應時間(ok.count和ko.count的平均值)
<rootMetricsPrefix><samplerName>.a.pct<percentileValue> 針對採樣器名稱的響應計算百分位數。每個計算值將有一個度量標準。(根據OK和失敗樣本的總數計算),backend listener的默認百分位數設置爲“90; 95; 99”,即3百分位數爲90%,95%和99%

 
Graphite命名層次使用點(“.”)分開的元素。這可能與十進制百分比混淆。JMeter轉換此類值,用下劃線(”_”)替換點(”.”)。例如,”99.9”變爲”99_9”

默認情況下,JMeter發送在samplerName “all” 下累積的所有采樣器的度量標準。如果Backend Listener中配置了samplersList,那麼JMeter還會發送匹配樣本名稱的度量,除非summaryOnly = true

JMeter配置

要使JMeter向後端發送指標,請使用GraphiteBackendListenerClient 添加BackendListener。
這裏寫圖片描述

InfluxDB數據庫配置

此部分在前博文中已有介紹,在此簡單說明一下

兩種方式

  • InfluxDBBackendListenerClient的InfluxDB設置
    使用InfluxDBBackendListenerClient時,不需要特定的配置
  • GraphiteBackendListenerClient的InfluxDB設置
    要在InfluxDB中爲GraphiteBackendListenerClient啓用Graphite listener,修改influxdb服務器上的配置文件/usr/local/etc/influxdb.conf,找到”[[graphite]]”並設置:
[root@test25 ~]# vim /etc/influxdb/influxdb.conf
……
[[graphite]]
    enabled = true
    bind-address = ":2003"
    database = "jmeter"
    retention-policy = ""
    protocol = "tcp"
    batch-size = 5000
    batch-pending = 10
    batch-timeout = "1s"
    consistency-level = "one"
    separator = "."
    udp-read-buffer = 0
……
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章