xrootdlib.structs.XrdXrootdMon package

Structs used for the Detailed Monitoring Data Format streams sent by servers. See the all.monitor directive and XRootD Monitoring for details.

All types implement a Type[T].from_XXX(buffer: bytes) -> T constructor method, where XXX describes the appropriate section. These section are buffer or record, which represent the stream buffer either at the start of a packet or the start of a record. Unless you explicitly have a need otherwise, use Packet.from_buffer() to read an entire packet at a time.

class Buff(records: List[Union[xrootdlib.structs.XrdXrootdMon.trace.AppId, xrootdlib.structs.XrdXrootdMon.trace.Close, xrootdlib.structs.XrdXrootdMon.trace.Disc, xrootdlib.structs.XrdXrootdMon.trace.Open, xrootdlib.structs.XrdXrootdMon.trace.ReadWrite, xrootdlib.structs.XrdXrootdMon.trace.ReadU, xrootdlib.structs.XrdXrootdMon.trace.ReadV, xrootdlib.structs.XrdXrootdMon.trace.Window]])

Bases: object

XrdXrootdMonBuff (“t-stream”) describing trace events

Parameters:records – individual file operation events

The records field contains various trace records framed by window marks (Window). In other words, records is a flat sequence of one or more sequences of records, with marks at the start, end and between sequences.

classmethod from_record(record_data: bytes, record_code: bytes = b't') → xrootdlib.structs.XrdXrootdMon.Buff

Extract the record from the record portion of a stream packet buffer

Parameters:
  • record_data – buffer at the start of the record of a monitor stream packet
  • record_code – the code field for this packet
Note:

The only valid record code for this class is b't'.

payload_dispatch = {<XROOTD_MON.OPEN: 128>: <class 'xrootdlib.structs.XrdXrootdMon.trace.Open'>, <XROOTD_MON.READV: 144>: <class 'xrootdlib.structs.XrdXrootdMon.trace.ReadV'>, <XROOTD_MON.READU: 145>: <class 'xrootdlib.structs.XrdXrootdMon.trace.ReadU'>, <XROOTD_MON.APPID: 160>: <class 'xrootdlib.structs.XrdXrootdMon.trace.AppId'>, <XROOTD_MON.CLOSE: 192>: <class 'xrootdlib.structs.XrdXrootdMon.trace.Close'>, <XROOTD_MON.DISC: 208>: <class 'xrootdlib.structs.XrdXrootdMon.trace.Disc'>, <XROOTD_MON.WINDOW: 224>: <class 'xrootdlib.structs.XrdXrootdMon.trace.Window'>}
records
class Burr(sid: xrootdlib.structs.XrdXrootdMon.redir.ServerIdent, records: List[Union[xrootdlib.structs.XrdXrootdMon.redir.Redirect, xrootdlib.structs.XrdXrootdMon.redir.ServerIdent, xrootdlib.structs.XrdXrootdMon.redir.WindowMark]])

Bases: object

XrdXrootdMonBurr (“r-stream”) describing redirection events

Parameters:
  • sid – identification of the server sending events
  • records – individual operations requested by clients

The records field contains redirection records (Redirect) framed by window marks (WindowMark). In other words, records is a flat sequence of one or more sequences of records, with marks at the start, end and between sequences.

end
classmethod from_record(record_data: bytes, record_code: bytes = b'r') → xrootdlib.structs.XrdXrootdMon.Burr

Extract the record from the record portion of a stream packet buffer

Parameters:
  • record_data – buffer at the start of the record of a monitor stream packet
  • record_code – the code field for this packet
Note:

The only valid record code for this class is b'r'.

records
sid
start
class Fstat(tod: xrootdlib.structs.XrdXrootdMon.fstat.FileTOD, records: List[Union[xrootdlib.structs.XrdXrootdMon.fstat.FileTOD, xrootdlib.structs.XrdXrootdMon.fstat.FileDSC, xrootdlib.structs.XrdXrootdMon.fstat.FileOPN, xrootdlib.structs.XrdXrootdMon.fstat.FileCLS, xrootdlib.structs.XrdXrootdMon.fstat.FileXFR]])

Bases: object

XrdXrootdMonFstat (“f-stream”) describing the general file access

Parameters:
  • tod – identifier for the server and time window
  • records – file operations and statistics

The records is a flat sequence of open records (FileOPN), transfer records (FileXFR, if fstat xfr is configured), close records (FileCLS), and disconnect records (FileDSC). As per the specification, for every access the records are provided in this order. However, records for one access may be spread over multiple time windows.

end
classmethod from_record(record_data: bytes, record_code: bytes = b'f') → xrootdlib.structs.XrdXrootdMon.Fstat

Extract the record from the record portion of a stream packet buffer

Parameters:
  • record_data – buffer at the start of the record of a monitor stream packet
  • record_code – the code field for this packet
Note:

The only valid record code for this class is b'f'.

payload_dispatch = {<recType.isClose: 0>: <class 'xrootdlib.structs.XrdXrootdMon.fstat.FileCLS'>, <recType.isOpen: 1>: <class 'xrootdlib.structs.XrdXrootdMon.fstat.FileOPN'>, <recType.isTime: 2>: <class 'xrootdlib.structs.XrdXrootdMon.fstat.FileTOD'>, <recType.isXFR: 3>: <class 'xrootdlib.structs.XrdXrootdMon.fstat.FileXFR'>, <recType.isDisc: 4>: <class 'xrootdlib.structs.XrdXrootdMon.fstat.FileDSC'>}
records
start
tod
class Header(code: bytes, pseq: int, plen: int, stod: int)

Bases: object

XrdXrootdMonHeader shared by all packets

Parameters:
  • code – identifier for the record type
  • pseq – wrapping counter for packet sequence
  • plen – size of the packet in bytes
  • stod – daemon start timestamp
code
classmethod from_buffer(buffer: bytes) → xrootdlib.structs.XrdXrootdMon.Header

Extract the header from the start of a stream packet buffer

Parameters:buffer – buffer containing a monitor stream packet
plen
pseq
size = 8
stod
struct_parser = <Struct object>
class Map(dictid: int, userid: xrootdlib.structs.XrdXrootdMon.map.UserId, payload: Union[xrootdlib.structs.XrdXrootdMon.map.SrvInfo, xrootdlib.structs.XrdXrootdMon.map.Path, xrootdlib.structs.XrdXrootdMon.map.AppInfo, xrootdlib.structs.XrdXrootdMon.map.PrgInfo, xrootdlib.structs.XrdXrootdMon.map.AuthInfo, xrootdlib.structs.XrdXrootdMon.map.XfrInfo])

Bases: object

XrdXrootdMonMap describing transactions and general information

Parameters:
  • dictid – identifier shared by all records referring to the same information
  • userid – identifier for the client session being monitored
  • payload – the actual information of this message

The Map provides general information that applies across several monitoring events. Events of other streams reference this with the dictid, or the sid of the UserId of SrvInfo payloads. Note that in case of SrvInfo payloads, the userid contains the server user data.

dictid
classmethod from_record(record_data: bytes, record_code: bytes) → xrootdlib.structs.XrdXrootdMon.Map

Extract the record from the record portion of a stream packet buffer

Parameters:
  • record_data – buffer at the start of the record of a monitor stream packet
  • record_code – the code field for this packet
payload
userid
class Packet(header: xrootdlib.structs.XrdXrootdMon.Header, record: Union[xrootdlib.structs.XrdXrootdMon.Map, xrootdlib.structs.XrdXrootdMon.Burr, xrootdlib.structs.XrdXrootdMon.Fstat, xrootdlib.structs.XrdXrootdMon.Buff])

Bases: object

XrdXrootdMon packet for a map, r, t, f or g stream

Parameters:
  • header – the header specifying type, ordering and size of the packet
  • record – the actual information carried by the packet
classmethod from_buffer(buffer: bytes)

Extract the entire packet from the start of a stream packet buffer

Parameters:buffer – buffer containing a monitor stream packet
header
record
record_dispatch = {b'=': <class 'xrootdlib.structs.XrdXrootdMon.Map'>, b'd': <class 'xrootdlib.structs.XrdXrootdMon.Map'>, b'f': <class 'xrootdlib.structs.XrdXrootdMon.Fstat'>, b'g': <class 'xrootdlib.structs.XrdXrootdMon.Plugin'>, b'i': <class 'xrootdlib.structs.XrdXrootdMon.Map'>, b'p': <class 'xrootdlib.structs.XrdXrootdMon.Map'>, b'r': <class 'xrootdlib.structs.XrdXrootdMon.Burr'>, b't': <class 'xrootdlib.structs.XrdXrootdMon.Buff'>, b'u': <class 'xrootdlib.structs.XrdXrootdMon.Map'>, b'x': <class 'xrootdlib.structs.XrdXrootdMon.Map'>}
size
PacketRecord = typing.Union[xrootdlib.structs.XrdXrootdMon.Map, xrootdlib.structs.XrdXrootdMon.Burr, xrootdlib.structs.XrdXrootdMon.Fstat, xrootdlib.structs.XrdXrootdMon.Buff]

Record types in a packet

class Plugin(tBeg: int, tEnd: int, records: List[Union[xrootdlib.structs.XrdXrootdMon.plugin.ProxyCache, xrootdlib.structs.XrdXrootdMon.plugin.ContextCache, xrootdlib.structs.XrdXrootdMon.plugin.TCPConnectionMonitor]])

Bases: object

XrdXrootdMonGS (“g-stream”) describing information from plug-ins such as Cache Context Manager, Proxy File Cache or TCP connection monitor

Parameters:
  • tBeg – UNIX time of the first entry
  • tEnd – UNIX time of the last entry
  • records – file operations and statistics
classmethod from_record(record_data: Union[bytes, memoryview], record_code: bytes = b'g') → xrootdlib.structs.XrdXrootdMon.Plugin

Extract the record from the record portion of a stream packet buffer

Parameters:
  • record_data – buffer at the start of the record of a monitor stream packet
  • record_code – the code field for this packet
Note:

The only valid record code for this class is b'g'.

payload_dispatch = {<pluginType.isPFC: b'C'>: <class 'xrootdlib.structs.XrdXrootdMon.plugin.ProxyCache'>, <pluginType.isCCM: b'M'>: <class 'xrootdlib.structs.XrdXrootdMon.plugin.ContextCache'>, <pluginType.isTCM: b'T'>: <class 'xrootdlib.structs.XrdXrootdMon.plugin.TCPConnectionMonitor'>}
records
tBeg
tEnd