Acspy.Common.loggingStatistics
index
/alma/ACS-2016.6/ACSSW/lib/python/site-packages/Acspy/Common/loggingStatistics.py

An interface to logging statistics calculation, including the statistics messages generation.
 
This module is designed to be used by the Python logger code, and to be
failsafe, so that the loggers task is guaranteed in (nearly)
all circumstances. Design choices derived from the design goals:
1) by default the logger statistics are disabled. Enabling them is an active
decision,
2) in case of being the logger statistics disable no impact over logger performances
is to be noted
3) no environment variables are configured / allowed for this module
4) each logger cames by default with its statistics module

 
Modules
       
time

 
Classes
       
__builtin__.object
LoggingStatistics

 
class LoggingStatistics(__builtin__.object)
    Logging statistics is used to keep track of the statistics of a logger class.
By default a the statistics calculation is disabled, so there is no impact over
system performances.
 
  Methods defined here:
__init__(self)
Create a Logger statistics instance.
 
Parameters: Nothing
 
Returns: Nothing
 
Raises: Nothing
calculateLoggingStatistics(self)
This method calculates the logging statistics.
 
Parameters: Nothing
 
Returns: Nothing
 
Raises: Nothing
configureStatistics(self, elementName, state, period, granularity)
This method allows the statistic module to be configured.
    
Parameters:
    - elementName String defining the name of the module the statistics belong to
    - state Configuration of disableStatistics attribute (to enable / diable statistics module)
    - period Configuration of statisticsCalculationPeriod
    - granularity Configuration of statisticsGranularity
 
Returns: Nothing
 
Raises: Nothing
getAccumulatedNumberOfLogErrors(self)
# Getter for accumulatedNumberOfLogErrors
getAccumulatedNumberOfMessages(self)
# Getter for accumulatedNumberOfMessages
getActualStatisticsPeriod(self)
# Statistics calculation methods
getDisableStatistics(self)
# Getter for disableStatistics
getErrorIncrement(self)
getErrorStatistics(self)
getLastPeriodNumberOfLogErrors(self)
# Getter for lastPeriodNumberOfLogErrors
getLastPeriodNumberOfMessages(self)
# Getter for lastPeriodNumberOfMessage
getLastStatisticsRepportTime(self)
# Getter for lastStatisticsRepportTime
getMessageIncrement(self)
getMessageStatistics(self)
getStatisticsCalculationPeriod(self)
# Getter for statisticsCalculationPeriod
getStatisticsGranularity(self)
# Getter for statisticsGranularity
getStatisticsIdentification(self)
# Getter for statisticsIdentification
incrementNumberOfLogErrors(self)
This method increases the value of the attribute that counts the number of logging errors
for the last period.
    
Parameters: Nothing
 
Returns: Nothing
 
Raises: Nothing
incrementNumberOfMessages(self)
This method increases the value of the attribute that counts the number of messages
for the last period.
    
Parameters: Nothing
 
Returns: Nothing
 
Raises: Nothing
resetStatistics(self)
This method makes a backup and resets the current statistics values.
    
Parameters: Nothing
 
Returns: Nothing
 
Raises: Nothing
retrieveStatisticsLogs(self, loggerId)
This method retrieves the logging statistics.
    
Parameters:
    - loggerId String to indentify the logger (normaly will consist on logger name + container name
 
Returns:
    - statisticsLogList List of logs (strings)
 
Raises: Nothing
setAccumulatedNumberOfLogErrors(self, value)
# Setter for accumulatedNumberOfLogErrors
setAccumulatedNumberOfMessages(self, value)
# Setter for accumulatedNumberOfMessages
setLastPeriodNumberOfLogErrors(self, value)
# Setter for lastPeriodNumberOfLogErrors
setLastPeriodNumberOfMessages(self, value)
# Setter for lastPeriodNumberOfMessage
setLastStatisticsRepportTime(self, value)
# Setter for lastStatisticsRepportTime
setStatisticsCalculationPeriod(self, value)
# Setter for statisticsCalculationPeriod
setStatisticsGranularity(self, value)
# Setter for statisticsGranularity

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes defined here:
CONST_DEFAULT_STATISTICS_GRANULARITY = 1
CONST_DEFAULT_STATISTICS_PERIOD = 600
CONST_DEFAULT_STATISTICS_STATE = True
CONST_INITIAL_NUMBER_ERRORS = 0
CONST_INITIAL_NUMBER_MESSAGES = 0