Skip to content

Loading…

elasticsearch: Calculate the aggregated gc stats as they're absent in elastisearch > 0.90.10 #531

Merged
merged 1 commit into from

2 participants

@barnybug

No description provided.

@kormoc kormoc merged commit ce4c3f2 into BrightcoveOS:master
@kormoc kormoc added a commit to kormoc/Diamond that referenced this pull request
@kormoc kormoc Re #531, this uses the gc based collection stats if they exist, falli…
…ng back to the ones we calculate
b5daf58
@kormoc
Open Source @ Brightcove member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 13, 2014
  1. Calculate the aggregated gc stats as they're absent in elastisearch >…

    Barnaby Gray committed
    … 0.90.10.
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/collectors/elasticsearch/elasticsearch.py
View
9 src/collectors/elasticsearch/elasticsearch.py
@@ -237,13 +237,18 @@ def collect(self):
metrics['jvm.threads.count'] = jvm['threads']['count']
gc = jvm['gc']
- metrics['jvm.gc.collection.count'] = gc['collection_count']
- metrics['jvm.gc.collection.time'] = gc['collection_time_in_millis']
+ collection_count = 0
+ collection_time_in_millis = 0
for collector, d in gc['collectors'].iteritems():
metrics['jvm.gc.collection.%s.count' % collector] = d[
'collection_count']
+ collection_count += d['collection_count']
metrics['jvm.gc.collection.%s.time' % collector] = d[
'collection_time_in_millis']
+ collection_time_in_millis += d['collection_time_in_millis']
+ # calculate the totals, as they're absent in elasticsearch > 0.90.10
+ metrics['jvm.gc.collection.count'] = collection_count
+ metrics['jvm.gc.collection.time'] = collection_time_in_millis
#
# thread_pool
Something went wrong with that request. Please try again.