adding lives action to the document of internal stats

This commit is contained in:
Cayo Puigdefabregas 2021-02-23 12:23:07 +01:00
parent e85b40c90f
commit 79902ee26d
2 changed files with 9 additions and 1 deletions

View File

@ -12,6 +12,7 @@ ml).
[1.0.5-beta] [1.0.5-beta]
## [1.0.5-beta] ## [1.0.5-beta]
- [addend] #124 adding endpoint for extract the internal stats of use
## [1.0.4-beta] ## [1.0.4-beta]
- [addend] #95 adding endpoint for check the hash of one report - [addend] #95 adding endpoint for check the hash of one report

View File

@ -413,15 +413,22 @@ class InternalStatsRow(OrderedDict):
for ac in self.actions: for ac in self.actions:
self.is_snapshot( self.is_snapshot(
self.is_deallocate( self.is_deallocate(
self.is_live(
self.is_allocate(ac) self.is_allocate(ac)
) )
) )
)
def is_allocate(self, ac): def is_allocate(self, ac):
if ac.type == 'Allocate': if ac.type == 'Allocate':
self['Allocates'] += 1 self['Allocates'] += 1
return ac return ac
def is_live(self, ac):
if ac.type == 'Live':
self['Lives'] += 1
return ac
def is_deallocate(self, ac): def is_deallocate(self, ac):
if ac.type == 'Deallocate': if ac.type == 'Deallocate':
self['Deallocates'] += 1 self['Deallocates'] += 1