Skip to content

Commit

Permalink
Make it possible to disable stats collection
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisMacNaughton committed Sep 18, 2018
1 parent 92d9efa commit 7c55dc5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions theblues/charmstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,14 @@ def _meta(self, entity_id, includes, channel=None):
data = self._get(url)
return data.json()

def entity(self, entity_id, get_files=False, channel=None):
def entity(self, entity_id, get_files=False, channel=None,
include_stats=True):
'''Get the default data for any entity (e.g. bundle or charm).
@param entity_id The entity's id either as a reference or a string
@param get_files Whether to fetch the files for the charm or not.
@param channel Optional channel name.
@param include_stats Optionally disable stats collection
'''
includes = [
'bundle-machine-count',
Expand All @@ -129,13 +131,14 @@ def entity(self, entity_id, get_files=False, channel=None):
'owner',
'revision-info',
'published',
'stats',
'resources',
'supported-series',
'terms'
]
if get_files:
includes.append('manifest')
if include_stats:
includes.append('stats')
return self._meta(entity_id, includes, channel=channel)

def entities(self, entity_ids):
Expand Down

0 comments on commit 7c55dc5

Please sign in to comment.