SummarizeLogsAgent
SummarizeLogsAgent module
This agents scans all the log tables (SiteLog, ResourceLog and NodeLog) on the ResourceStatusDB and summarizes them. The results are stored on the History tables (SiteHistory, ResourceHistory and NodeHistory) and the Log tables cleared.
In order to summarize the logs, all entries with no changes on the Status or TokenOwner column for a given (Name, StatusType) tuple are discarded.
The agent also adds a little prevention to avoid messing the summaries if the agent is restarted / killed abruptly. Please, please, please, DO NOT DO IT !
SummarizeLogsAgent
{
#Time between cycles in seconds
PollingTime = 300
#Months of history to keep
Months = 36
}
- class DIRAC.ResourceStatusSystem.Agent.SummarizeLogsAgent.SummarizeLogsAgent(*args, **kwargs)
Bases:
AgentModule
SummarizeLogsAgent as extension of AgentModule.
- __init__(*args, **kwargs)
Constructor.
- am_Enabled()
- am_checkStopAgentFile()
- am_createStopAgentFile()
- am_getControlDirectory()
- am_getCyclesDone()
- am_getMaxCycles()
- am_getModuleParam(optionName)
- am_getOption(optionName, defaultValue=None)
Gets an option from the agent’s configuration section. The section will be a subsection of the /Systems section in the CS.
- am_getPollingTime()
- am_getShifterProxyLocation()
- am_getStopAgentFile()
- am_getWatchdogTime()
- am_getWorkDirectory()
- am_go()
- am_initialize(*initArgs)
Common initialization for all the agents.
This is executed every time an agent (re)starts. This is called by the AgentReactor, should not be overridden.
- am_removeStopAgentFile()
- am_secureCall(functor, args=(), name=False)
- am_setModuleParam(optionName, value)
- am_setOption(optionName, value)
- am_stopExecution()
- beginExecution()
- endExecution()
- execute(main method)
The execute method runs over the three families of tables (Site, Resource and Node) performing identical operations. First, selects all logs for a given family (and keeps track of which one is the last row ID). It summarizes the logs and finally, deletes the logs from the database.
At last, this agent removes older entries from history tables
- Returns:
S_OK
- finalize()
- initialize()
Standard initialize.
- Returns:
S_OK