MonitoringClient

Exposes singleton object gMonitor, which is instance of MonitoringClient class

Uses RPC Framework/Monitoring service. Calls registerActivities exposed function

class DIRAC.FrameworkSystem.Client.MonitoringClient.MonitoringClient

Bases: object

It accumulates monitoring info from components before flushing using gMonitoringFlusher

COMPONENT_AGENT = 'agent'
COMPONENT_SCRIPT = 'script'
COMPONENT_SERVICE = 'service'
COMPONENT_WEB = 'web'
OP_ACUM = 'acum'
OP_MEAN = 'mean'
OP_RATE = 'rate'
OP_SUM = 'sum'
activitiesLock
addMark(name, value=1)

Add a new mark to the specified activity

Parameters:
  • name (string) – Name of the activity to report
  • value (number) – Weight of the mark. By default it’s one.
disable()
enable()
flush(allData=False)
flushingLock
forceFlush(exitCode)
getComponentsStatus(condDict)
getComponentsStatusWebFormatted(condDict={}, sortingList=[], startItem=0, maxItems=0)
initialize()
registerActivity(name, description, category, unit, operation, bucketLength=60)

Register new activity. Before reporting information to the server, the activity must be registered.

Parameters:
  • name (string) – Id of the activity to report
  • description (string) – Description of the activity
  • category (string) – Grouping of the activity
  • unit (string) – String representing the unit that will be printed in the plots
  • operation (string) – Type of data operation to represent data. All the possibilities are defined in the Constants.py file
  • bucketLength (int) – Bucket length in seconds
setComponentExtraParam(name, value)
setComponentLocation(componentLocation=False)

Set the location of the component reporting.

Parameters:componentLocation (string) – Location of the component reporting
setComponentName(componentName)

Set the name of the component reporting.

Parameters:componentName (string) – Name of the component reporting
setComponentType(componentType)

Define the type of component reporting data.

Parameters:componentType (string) – Defines the grouping of the host by type. All the possibilities are defined in the Constants.py file
exception DIRAC.FrameworkSystem.Client.MonitoringClient.MonitoringClientActivityNotDefined(message)

Bases: exceptions.Exception

args
message
exception DIRAC.FrameworkSystem.Client.MonitoringClient.MonitoringClientActivityValueTypeError(message)

Bases: exceptions.Exception

args
message
exception DIRAC.FrameworkSystem.Client.MonitoringClient.MonitoringClientUnknownParameter(message)

Bases: exceptions.Exception

args
message
class DIRAC.FrameworkSystem.Client.MonitoringClient.MonitoringFlusher

Bases: object

This class flushes all monitoring clients registered

flush(allData=False)
registerMonitoringClient(mc)