第6章 統計、メトリクス、および JMX の設定

Data Grid が metrics エンドポイントに、または JMX MBean を介してエクスポートする統計を有効にします。JMX MBean を登録することで、管理操作を実施することもできます。

6.1. Data Grid 統計の有効化

Cache Manager およびキャッシュの統計をエクスポートするように Data Grid を設定します。

手順

以下のいずれかの方法で、Data Grid 統計が有効化されるように設定を変更します。

  • 宣言型: statistics="true" 属性を追加します。
  • プログラマティック: .statistics() メソッドを呼び出します。

宣言型

<!-- Enables statistics for the Cache Manager. -->
<cache-container statistics="true">
  <!-- Enables statistics for the named cache. -->
  <local-cache name="mycache" statistics="true"/>
</cache-container>

プログラマティック

GlobalConfiguration globalConfig = new GlobalConfigurationBuilder()
  //Enables statistics for the Cache Manager.
  .cacheContainer().statistics(true)
  .build();

Configuration config = new ConfigurationBuilder()
  //Enables statistics for the named cache.
  .statistics().enable()
  .build();