intra-mart Accel Platform 設定ファイルリファレンス 第33版 2023-10-01

メーター

ヘルスメーターはResinの管理コンソール(/resin-admin)に視覚的にわかり易くグラフを表示することができます。

設定

health.xml

health.xmlにはあらかじめJMXメーターが設定されています。health.xmlの詳細な記述については 診断 を参照してください。

ヘルスメーター名

ヘルスメーター名はキーをパイプ文字(|)で連結して名前が付けられています。
ヘルスメーターの統計はResinクラスタの各メンバー間で共有されているため、クラスタ間でユニークであることを保証するためにメンバーのインデックスをヘルスメーター名の先頭に付加します。
名前に含まれるパイプ文字は、ヘルスメーターをドリルダウンに分類して管理コンソールに表示するためにも使用されます。下記の例を参照してください。
<health:JmxDeltaMeter>
  <name>JVM|Compilation|Compilation Time</name>
  <object-name>java.lang:type=Compilation</object-name>
  <attribute>TotalCompilationTime</attribute>
</health:JmxDeltaMeter>
この例では JVM|Compilation|Compilation Time をベースにヘルスメーター名を提供します。クラスタメンバーのインデックスが0の場合は「00|」を先頭に付加します。
管理コンソールではクラスタメンバーのインデックスと最初の2つのキーを使用し、倫理的にドリルダウンしてグラフを表示します。
00|JVM|Compilation|Compilation Time

JMXメーター

JMX MBean属性の数値をヘルスメーターにグラフ表示することができます。

<health:JmxMeter>

JMX MBeanの数値属性の現在値をグラフに表示します。

属性

属性名 説明 デフォルト
name 管理コンソールに表示するヘルスメーターの名前 String なし
objectName JMX MBean の名前 String なし
attribute サンプリングするMBeanの属性 String なし

設定例

<health:JmxMeter>
  <name>OS|Memory|Physical Memory Free</name>
  <object-name>java.lang:type=OperatingSystem</object-name>
  <attribute>FreePhysicalMemorySize</attribute>
</health:JmxMeter>

<health:JmxDeltaMeter>

JMX MBeanの数値属性の現在値と以前の値の差をグラフに表示します。

属性

属性名 説明 デフォルト
name 管理コンソールに表示するヘルスメーターの名前 String なし
objectName JMX MBean の名前 String なし
attribute サンプリングするMBeanの属性 String なし

設定例

<health:JmxDeltaMeter>
  <name>JVM|Compilation|Compilation Time</name>
  <object-name>java.lang:type=Compilation</object-name>
  <attribute>TotalCompilationTime</attribute>
</health:JmxDeltaMeter>

統計分析

<health:AnomalyAnalyzer>

AnomalyAnalyzerは平均値からの偏差をチェックし現在の値を監視します。
突然スレッドがブロックされた場合など異常な変化を検出することができます。

属性

属性名 説明 デフォルト
meter 分析するヘルスメーターの名前(<health:JmxMeter>に設定されている名前) String なし(必須)
health-event <health:IfHealthEvent>の条件に一致させるための文字列 String なし(未指定時にイベントは発生しません)
min-samples 平均値を計算するために必要なサンプルの最小数 int 60(一般的な1時間のデータ数)
sigma-threshold 標準偏差から異常とみなされるサンプルの数 int 5

設定例

<health:JmxMeter>
  <name>JVM|Thread|JVM Blocked Count</name>
  <objectName>resin:type=JvmThreads</objectName>
  <attribute>BlockedCount</attribute>
</health:JmxMeter>

<health:AnomalyAnalyzer>
  <meter>JVM|Thread|JVM Blocked Count</meter>
  <health-event>caucho.thread.anomaly.jvm-blocked</health-event>
</health:AnomalyAnalyzer>

<health:DumpThreads>
  <health:IfHealthEvent regexp="caucho.thread"/>
  <health:IfNotRecent time="15m"/>
</health:DumpThreads>

<health:IfHealthEvent>

一致するヘルスイベントに応じてアクションを起こします。これは、通常、<health-event>属性を持つAnomalyAnalyzerと組み合わせて使用​​します。

属性

属性名 説明 デフォルト
regexp <health-event> が一致する正規表現。 java.util.regex.Pattern なし(必須)

設定例

<health:JmxMeter>
  <name>JVM|Thread|JVM Blocked Count</name>
  <objectName>resin:type=JvmThreads</objectName>
  <attribute>BlockedCount</attribute>
</health:JmxMeter>

<health:AnomalyAnalyzer>
  <meter>JVM|Thread|JVM Blocked Count</meter>
  <health-event>caucho.thread.anomaly.jvm-blocked</health-event>
</health:AnomalyAnalyzer>

<health:DumpThreads>
  <health:IfHealthEvent regexp="caucho.thread"/>
  <health:IfNotRecent time="15m"/>
</health:DumpThreads>