zoukankan      html  css  js  c++  java
  • jmeter-性能监控(InfluxDB+Grafana)

     测试结果实时监控:jmeter+influxdb+grafana

    • InfluxDB:存储实时数据的DB
    • Grafana:DB中存储的实时数据可以在浏览器查看

    --------------------------------------------------配置如下:---------------------------------------------------------------------

    一. InfluxDB配置

    • 安装目录下找到influxdb.conf 文件进行修改如下:

    # 找到graphite并且修改它的库与端口
    [[graphite]] # Determines whether the graphite endpoint
    is enabled. enabled = true database = "jmeter" retention-policy = "" bind-address = ":2003" protocol = "tcp" consistency-level = "one"

    # 找到admin,将前面的#号去掉,开放它的UI端口

    [admin]
    # Determines whether the admin service is enabled.
    enabled = true

    
    

    # The default bind address used by the admin service.
    bind-address = ":8083"

     
    • 启动influxdb:安装目录下的influxd.exe 文件

    二. Grafana配置

    • 下载并安装grafana
    • 启动grafana服务:D:grafana-4.5.2in 目录下的grafana-server.exe 程序
    • 打开网址:http://192.168.8.197:3000,
    • 配置数据源:

    【注意】- 8083端口是InfluxDB的UI界面展示的端口,- 8086端口是Grafana用来从数据库取数据的端口

    三. jmeter 配置

    • 增加监听器-Backend Listener,实现方式选择influxdb方式,如下图配置(influxdbur配置成:  http://192.168.8.197:8086/write?db=jmeter)
    • 可以添加单个请求的结果树查看配置后是否运行正常

    四. 配置Grafana面板

    • 添加统计面板:Dashboards--+New :(图1)
    • 鼠标移动到面板窗口左侧显示:(图2)
    • 编辑统计内容,鼠标移动到panel标题处,点击edit:(图3)
    • 在metric中设置数据源和统计维度:数据源选择jmeter

      图1             图2

     图3

  • 相关阅读:
    day01【MySQL数据库软件、SQL】
    【Junit单元测试、反射、注解】
    day13【Stream流、方法引用】
    day12【函数式接口】
    day11【网络编程】
    day10【缓冲流、转换流、序列化流】
    day09【字节流、字符流】
    day08【File类、递归】
    day07【线程池、Lambda表达式】
    day06 【线程、同步】
  • 原文地址:https://www.cnblogs.com/nzyjlr/p/7754381.html
Copyright © 2011-2022 走看看