Skip to content
Snippets Groups Projects
Commit 85c365a4 authored by Stefano Di Frischia's avatar Stefano Di Frischia
Browse files

L2SS-375: add archiving load monitoring

parent cddfb554
No related branches found
No related tags found
1 merge request!153Resolve L2SS-375 "Archiving load"
...@@ -287,6 +287,20 @@ class Archiver(): ...@@ -287,6 +287,20 @@ class Archiver():
else: else:
logger.warning(f"Attribute {attribute_name} not found!") logger.warning(f"Attribute {attribute_name} not found!")
def get_attribute_failures(self,attribute_name:str):
"""
Return the attribute failure archiving frequency in events/minute
"""
if (len(attribute_name.split('/'))!=4):
raise AttributeFormatException
if self.is_attribute_archived(attribute_name):
fail_dict = dict((a,r) for a,r in zip(self.es.AttributeList,self.es.AttributeFailureFreqList))
for f in fail_dict:
if attribute_name.lower() in f:
return fail_dict.get(f,0.)
else:
logger.warning(f"Attribute {attribute_name} not found!")
class AttributeFormatException(Exception): class AttributeFormatException(Exception):
""" """
Exception that handles wrong attribute naming Exception that handles wrong attribute naming
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment