zoukankan      html  css  js  c++  java
  • 性能测试之JVM的监控Grafana

    安装配置Grafana参考
    https://testerhome.com/articles/23629

    使用配置

    1. 下载jmx_exporter
    https://github.com/prometheus/jmx_exporter
    
    1. 创建jmx_exporter配置文件
    vim simple-config.yml
    
    lowercaseOutputLabelNames: true
    lowercaseOutputName: true
    whitelistObjectNames: ["java.lang:type=OperatingSystem"]
    blacklistObjectNames: []
    rules:
      - pattern: 'java.lang<type=OperatingSystem><>(committed_virtual_memory|free_physical_memory|free_swap_space|total_physical_memory|total_swap_space)_size:'
        name: os_$1_bytes
        type: GAUGE
        attrNameSnakeCase: true
      - pattern: 'java.lang<type=OperatingSystem><>((?!process_cpu_time)w+):'
        name: os_$1
        type: GAUGE
        attrNameSnakeCase: true
    

    javaagent启动应用
    java -javaagent:./jmx_prometheus_javaagent-0.14.0.jar=8080:simple-config.yaml -jar yourJar.jar

    1. 在prometheus配置文件中添加配置
    scrape_configs:
      - job_name: 'java'
        static_configs:
        - targets: ['<host>:<port>']
    
    1. 重启prometheus
    nohup ./prometheus  > prometheus.log 2>&1 &
    
    1. 下载并导入dashboards
    https://grafana.com/grafana/dashboards/7727
    https://grafana.com/grafana/dashboards/8563
    注:8563模板对7727有依赖,所以需全部安装,否则不能正常使用
    

    效果图



    扫一扫,关注我

  • 相关阅读:
    1212321
    123123
    好好干活
    VXLAN学习之路-结合VRF在Linux中实践VXLAN网络
    123456
    期望
    123456
    123456
    Jenkins管理员密码忘记修改操作
    Jenkins 安装与部署详细教程
  • 原文地址:https://www.cnblogs.com/hally/p/13966697.html
Copyright © 2011-2022 走看看