• 心跳报表配置
    • 配置入口
    • 配置示例说明

    心跳报表配置

    配置入口

    http://localhost:8080/cat/s/config?op=displayPolicy

    配置示例说明

    心跳模板配置的Sample如下:

    1. <?xml version="1.0" encoding="utf-8"?>
    2. <heartbeat-display-policy>
    3. <group id="System" order="1">
    4. <metric id="LoadAverage" unit="1" delta="false" order="1" lable="个数" alert="true"/>
    5. <metric id="FreePhysicalMemory" unit="M" delta="false" order="1" lable="MB" alert="false"/>
    6. <metric id="FreeSwapSpaceSize" unit="M" delta="false" order="1" lable="MB" alert="false"/>
    7. </group>
    8. <group id="GC" order="2">
    9. <metric id="ParNewCount" unit="1" delta="true" order="1" lable="次数" alert="true"/>
    10. <metric id="ParNewTime" unit="1000" delta="true" order="1" lable="秒" alert="false"/>
    11. <metric id="ConcurrentMarkSweepCount" unit="1" delta="true" order="1" title="OldGcCount" lable="次数" alert="true"/>
    12. <metric id="PS MarkSweepCount" unit="1" delta="true" order="1" title="OldGcCount" lable="次数" alert="true"/>
    13. <metric id="ConcurrentMarkSweepTime" unit="1" delta="true" order="1" title="OldGcTime" lable="毫秒" alert="false"/>
    14. <metric id="G1 Young GenerationCount" unit="1" delta="true" order="1" lable="次数" alert="true"/>
    15. <metric id="G1 Young GenerationTime" unit="1000" delta="true" order="1" lable="秒" alert="true"/>
    16. <metric id="G1 Old GenerationCount" unit="1" delta="true" order="1" lable="次数" alert="true"/>
    17. <metric id="G1 Old GenerationTime" unit="1000" delta="true" order="1" lable="秒" alert="true"/>
    18. </group>
    19. <group id="JVMHeap" order="3">
    20. <metric id="Eden Usage" unit="M" delta="false" order="1" lable="MB" alert="false"/>
    21. <metric id="G1 Eden Space" unit="M" delta="false" order="1" lable="MB" alert="false"/>
    22. <metric id="Survivor Usage" unit="M" delta="false" order="2" lable="MB" alert="false"/>
    23. <metric id="G1 Survivor Space" unit="M" delta="false" order="1" lable="MB" alert="false"/>
    24. <metric id="Code Cache" unit="M" delta="false" order="3" lable="MB" alert="false"/>
    25. <metric id="Par Eden Space" unit="M" delta="false" order="4" lable="MB" alert="false"/>
    26. <metric id="Par Survivor Space" unit="M" delta="false" order="5" lable="MB" alert="false"/>
    27. <metric id="CMS Old Gen" unit="M" delta="false" order="6" lable="MB" alert="false"/>
    28. <metric id="G1 Old Gen" unit="M" delta="false" order="6" lable="MB" alert="false"/>
    29. <metric id="CMS Perm Gen" unit="M" delta="false" order="7" lable="MB" alert="false"/>
    30. <metric id="G1 Perm Gen" unit="M" delta="false" order="7" lable="MB" alert="false"/>
    31. </group>
    32. <group id="FrameworkThread" order="4">
    33. <metric id="HttpThread" unit="1" delta="false" order="1" lable="个数" alert="true"/>
    34. <metric id="PigeonThread" unit="1" delta="false" order="2" lable="个数" alert="true"/>
    35. <metric id="ActiveThread" unit="1" delta="false" order="3" lable="个数" alert="true"/>
    36. <metric id="CatThread" unit="1" delta="false" order="4" lable="个数" alert="false"/>
    37. <metric id="StartedThread" unit="1" delta="true" order="5" lable="个数" alert="false"/>
    38. </group>
    39. <group id="Disk" order="5">
    40. <metric id="/ Free" unit="M" delta="false" order="1" lable="MB" alert="false"/>
    41. <metric id="/data Free" unit="M" delta="false" order="2" lable="MB" alert="true"/>
    42. </group>
    43. <group id="CatUsage" order="6">
    44. <metric id="Produced" unit="1" delta="true" order="1" lable="个数" alert="false"/>
    45. <metric id="Overflowed" unit="1" delta="true" order="2" lable="个数" alert="false"/>
    46. <metric id="Bytes" unit="M" delta="true" order="2" lable="MB" alert="false"/>
    47. </group>
    48. <group id="HeapUsage" order="7">
    49. <metric id="EdenUsage" unit="M" delta="false" order="1" lable="MB" alert="false"/>
    50. <metric id="SurvivorUsage" unit="M" delta="false" order="2" lable="MB" alert="false"/>
    51. <metric id="CodeCache" unit="M" delta="false" order="3" lable="MB" alert="false"/>
    52. <metric id="ParEdenSpace" unit="M" delta="false" order="4" lable="MB" alert="false"/>
    53. <metric id="ParSurvivorSpace" unit="M" delta="false" order="5" lable="MB" alert="false"/>
    54. <metric id="CMSOldGen" unit="M" delta="false" order="6" lable="MB" alert="false"/>
    55. <metric id="CMSPermGen" unit="M" delta="false" order="7" lable="MB" alert="false"/>
    56. </group>
    57. </heartbeat-display-policy>

    配置说明:

    group 分类:代表心跳指标的某个类别的指标集合,例如 JVM、System、Disk等。

    • id : 分类名称
    • order : 心跳报表中的展示顺序

    metric 指标: 代表 group 中具体指标

    • id : 指标名称
    • unit : 指标数值的单位(K、M、G、自定义数值),图表显示值 = 真实值 / unit
    • delta : 是否增量统计,对业务方透明。
    • order : group 内的展示顺序
    • lable : 图表纵坐标的单位

    CAT 默认收集了部分心跳信息,例如 GC、JVM、System、Disk、FrameworkThread、CatUsage等。若有其他指标需求,可以做相应扩展代码以及心跳配置。