Skip to content

Commit

Permalink
Re BrightcoveOS#531, this uses the gc based collection stats if they …
Browse files Browse the repository at this point in the history
…exist, falling back to the ones we calculate
  • Loading branch information
kormoc committed Feb 17, 2014
1 parent ce4c3f2 commit b5daf58
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/collectors/elasticsearch/elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,16 @@ def collect(self):
'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
if 'collection_count' in gc:
metrics['jvm.gc.collection.count'] = gc['collection_count']
else:
metrics['jvm.gc.collection.count'] = collection_count

k = 'collection_time_in_millis'
if k in gc:
metrics['jvm.gc.collection.time'] = gc[k]
else:
metrics['jvm.gc.collection.time'] = collection_time_in_millis

#
# thread_pool
Expand Down

0 comments on commit b5daf58

Please sign in to comment.