Permalink
Browse files

provided GC metrics can vary

  • Loading branch information...
Andre Lewis
Andre Lewis committed Oct 3, 2012
1 parent 20aa1ea commit 2cf9c76fb6d39fb1e4609e0979cd0b2af056d67e
Showing with 5 additions and 2 deletions.
  1. +5 −2 elasticsearch_cluster_node_status/elasticsearch_cluster_node_status.rb
@@ -45,8 +45,11 @@ def build_report
report(:threads_count => response['jvm']['threads']['count'] || 0)
gc_time(:gc_collection_time => response['jvm']['gc'])
- gc_time(:gc_parnew_collection_time => response['jvm']['gc']['collectors']['ParNew'])
- gc_time(:gc_cms_collection_time => response['jvm']['gc']['collectors']['ConcurrentMarkSweep'])
+ # Additional GC metrics provided by ElasticSearch can vary:
+ gc_time(:gc_parnew_collection_time => response['jvm']['gc']['collectors']['ParNew']) if response['jvm']['gc']['collectors']['ParNew']
+ gc_time(:gc_cms_collection_time => response['jvm']['gc']['collectors']['ConcurrentMarkSweep']) if response['jvm']['gc']['collectors']['ConcurrentMarkSweep']
+ gc_time(:gc_copy_collection_time => response['jvm']['gc']['collectors']['Copy']) if response['jvm']['gc']['collectors']['Copy']
+ gc_time(:gc_msc_coolection_time => response['jvm']['gc']['collectors']['MarkSweepCompact']) if response['jvm']['gc']['collectors']['MarkSweepCompact']
rescue OpenURI::HTTPError
error("Stats URL not found", "Please ensure the base url for elasticsearch cluster node stats is correct. Current URL: \n\n#{base_url}")

0 comments on commit 2cf9c76

Please sign in to comment.