elasticsearch_cluster_node_status/elasticsearch_cluster_node_status.rb
# Reports the time spent in collection / # of collections for this reporting period.
Reports the time spent in collection / # of collections for this reporting period.
Reports the time spent in collection / # of collections for this reporting period .
def gc_time(data)
    key = data.keys.first.to_s
    collection_time = data.values.first['collection_time_in_millis'] || 0
    collection_count = data.values.first['collection_count'] || 1
    previous_collection_time = memory(key)
    previous_collection_count = memory(key.sub('time','count'))
    if previous_collection_time and previous_collection_count
      rate = (collection_time-previous_collection_time).to_f/(collection_count-previous_collection_count)
      if rate >=0 
        report(data.keys.first => rate) 
      elsif rate.nan? 
        report(data.keys.first => 0) 
      end
    end
    remember(key => collection_time || 0)
    remember(key.sub('time','count') => collection_count || 1)
  end
def gc_time ( data ) key = data . keys . first . to_s collection_time = data . values . first [ 'collection_time_in_millis' ] || 0 collection_count = data . values . first [ 'collection_count' ] || 1 previous_collection_time = memory ( key ) previous_collection_count = memory ( key . sub ( 'time' , 'count' ) ) if previous_collection_time and previous_collection_count rate = ( collection_time - previous_collection_time ) . to_f / ( collection_count - previous_collection_count ) if rate >= 0 report ( data . keys . first => rate ) elsif rate . nan? report ( data . keys . first => 0 ) end end remember ( key => collection_time || 0 ) remember ( key . sub ( 'time' , 'count' ) => collection_count || 1 ) end
Reports the time spent in collection / # of collections for this reporting period.
Reports the time spent in collection / # of collections for this reporting period .
# assuming that restarting elasticsearch restarts counts, which means the rate could be < 0. # no activity
data
<not_specific>