Grafana看板整理

自定义一个jmeter性能监控看板。看板如下:


image.png

image.png

变量

image.png

image.png

image.png

数据源:

image.png

表:


image.png

application:

SHOW TAG VALUES FROM $measurement WITH KEY = "application"
image.png

transaction:

SHOW TAG VALUES FROM $measurement WITH KEY = "transaction" 
WHERE "transaction" != 'internal' AND "transaction" != 'all' 
AND "application" =~ /^$application$/
image.png

指标

tps_success:

SELECT mean("count") FROM /^$measurement$/ WHERE 
("application" =~ /^$application$/ AND "transaction" =~ /^$transaction$/ 
AND "statut" = 'ok') 
AND $timeFilter 
GROUP BY time(5s), "transaction" fill(null)
image.png

tps_fail:

SELECT mean("count") FROM /^$measurement$/ WHERE 
("application" =~ /^$application$/ 
AND "transaction" =~ /^$transaction$/ AND "statut" = 'ko') 
AND $timeFilter GROUP BY time(5s), "transaction" fill(null)
image.png

响应时间:

SELECT mean("avg") FROM /^$measurement$/ WHERE 
("application" =~ /^$application$/ AND "transaction" =~ /^$transaction$/) 
AND $timeFilter 
GROUP BY time(10s), "transaction" fill(null)
image.png

事务数:

SELECT sum("count")  / 0.5 FROM "Jmeter_1460" WHERE
 ("transaction" =~ /^$transaction$/ 
AND "application" =~ /^$application$/ 
AND "statut" = 'all') 
AND $timeFilter GROUP BY time(1h)

平均tps:

SELECT mean("count") FROM "Jmeter_1460" WHERE 
("statut" = 'ok' AND "transaction" =~ /^$transaction$/) 
AND $timeFilter GROUP BY time(5s), "transaction"

平均响应时间:

SELECT mean("pct90.0") FROM "Jmeter_1460" WHERE 
("application" =~ /^$application$/ AND "transaction" =~ /^$transaction$/) 
AND $timeFilter 
GROUP BY time(10s), "transaction" fill(null)

聚合报告

SELECT  mean("count") AS "tps",
mean("avg") AS "avg",
mean("pct90.0") AS "90% line",
mean("pct95.0") AS "95% line", 
mean("pct99.0") AS "99% line", 
max("max") AS "max line",
sum("count") AS "total" FROM "jmeter" 
WHERE ("application" =~ /^$application$/ AND "statut" = 'ok') 
AND $timeFilter 
GROUP BY "transaction"
image.png

网络

SELECT mean("sb") FROM "measurement" 
WHERE $timeFilter 
GROUP BY time($__interval) fill(null)
SELECT mean("rb") FROM "$measurement_name" WHERE 
("application" =~ /^$application$/) AND $timeFilter 
GROUP BY "transaction", time($__interval) fill(null)

错误率

SELECT sum("error") / sum("all") FROM (SELECT sum("count") AS "all" 
FROM "$measurement_name" WHERE "transaction" =~ /^$transaction$/ 
AND "statut" = 'all' AND "application" =~ /^$application$/ 
AND $timeFilter GROUP BY time($__interval) fill(null)), 
(SELECT sum("count") AS "error" FROM "$measurement_name" 
WHERE "transaction" =~ /^$transaction$/ AND "statut" = 'ko' 
AND "application" =~ /^$application$/ AND $timeFilter 
GROUP BY time($__interval) fill(null))

你可能感兴趣的:(Grafana看板整理)