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:
objectXrdXrootdMonBuff(“t-stream”) describing trace eventsParameters: records – individual file operation events The
recordsfield contains various trace records framed by window marks (Window). In other words,recordsis 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
codefield for this packet
Note: The only valid record code for this class is
b't'.
-
payload_dispath= {<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¶
-
classmethod
-
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:
objectXrdXrootdMonBurr(“r-stream”) describing redirection eventsParameters: - sid – identification of the server sending events
- records – individual operations requested by clients
The
recordsfield contains redirection records (Redirect) framed by window marks (WindowMark). In other words,recordsis 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
codefield 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:
objectXrdXrootdMonFstat(“f-stream”) describing the general file accessParameters: - tod – identifier for the server and time window
- records – file operations and statistics
The
recordsis a flat sequence of open records (FileOPN), transfer records (FileXFR, iffstat xfris 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
codefield for this packet
Note: The only valid record code for this class is
b'f'.
-
payload_dispath= {<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:
objectXrdXrootdMonHeadershared by all packetsParameters: - 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:
objectXrdXrootdMonMapdescribing transactions and general informationParameters: - 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
Mapprovides general information that applies across several monitoring events. Events of other streams reference this with thedictid, or thesidof theUserIdofSrvInfopayloads. Note that in case ofSrvInfopayloads, theuseridcontains 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
codefield 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:
objectXrdXrootdMonpacket for a map, r, t or f streamParameters: - 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_dispath= {b'=': <class 'xrootdlib.structs.XrdXrootdMon.Map'>, b'd': <class 'xrootdlib.structs.XrdXrootdMon.Map'>, b'f': <class 'xrootdlib.structs.XrdXrootdMon.Fstat'>, 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