Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Feb 17, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/collectors/elasticsearch/elasticsearch.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -237,13 +237,18 @@ def collect(self):
metrics['jvm.threads.count'] = jvm['threads']['count'] metrics['jvm.threads.count'] = jvm['threads']['count']


gc = jvm['gc'] gc = jvm['gc']
metrics['jvm.gc.collection.count'] = gc['collection_count'] collection_count = 0
metrics['jvm.gc.collection.time'] = gc['collection_time_in_millis'] collection_time_in_millis = 0
for collector, d in gc['collectors'].iteritems(): for collector, d in gc['collectors'].iteritems():
metrics['jvm.gc.collection.%s.count' % collector] = d[ metrics['jvm.gc.collection.%s.count' % collector] = d[
'collection_count'] 'collection_count']
collection_count += d['collection_count']
metrics['jvm.gc.collection.%s.time' % collector] = d[ metrics['jvm.gc.collection.%s.time' % collector] = d[
'collection_time_in_millis'] '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 # thread_pool
Expand Down