XRootD
Loading...
Searching...
No Matches
XrdXrootdMonData.hh
Go to the documentation of this file.
1#ifndef __XRDXROOTDMONDATA__
2#define __XRDXROOTDMONDATA__
3/******************************************************************************/
4/* */
5/* X r d X r o o t d M o n D a t a . h h */
6/* */
7/* (c) 2004 by the Board of Trustees of the Leland Stanford, Jr., University */
8/* All Rights Reserved */
9/* Produced by Andrew Hanushevsky for Stanford University under contract */
10/* DE-AC02-76-SFO0515 with the Department of Energy */
11/* */
12/* This file is part of the XRootD software suite. */
13/* */
14/* XRootD is free software: you can redistribute it and/or modify it under */
15/* the terms of the GNU Lesser General Public License as published by the */
16/* Free Software Foundation, either version 3 of the License, or (at your */
17/* option) any later version. */
18/* */
19/* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22/* License for more details. */
23/* */
24/* You should have received a copy of the GNU Lesser General Public License */
25/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27/* */
28/* The copyright holder's institutional names and contributor's names may not */
29/* be used to endorse or promote products derived from this software without */
30/* specific prior written permission of the institution or contributor. */
31/******************************************************************************/
32
33#include "XProtocol/XPtypes.hh"
34
35/******************************************************************************/
36/* P a c k e t D e f i n i t i o n s */
37/******************************************************************************/
38
40 {kXR_char code; // '='|'d'|'f'|'i'|'p'|'r'|'t'|'u'|'x'
41 kXR_char pseq; // packet sequence
42 kXR_unt16 plen; // packet length
43 kXR_int32 stod; // Unix time at Server Start
44 };
45
47 {union {kXR_int64 val;
48 kXR_char id[8];
49 kXR_unt16 sVal[4];
50 kXR_unt32 rTot[2]; } arg0;
55 kXR_int32 Window; } arg2;
56 };
57
62
65 struct {kXR_char Type;
68 } rdr; } arg0;
70 kXR_int32 Window; } arg1;
71 };
72
75 union {kXR_int64 sID;
76 kXR_char sXX[8]; };
77 XrdXrootdMonRedir info[sizeof(XrdXrootdMonRedir)]; //This is really [n]
78 };
79
82 int tBeg; // time(0) of the first record
83 int tEnd; // time(0) of the last record
84 kXR_int64 sID; // Server id in lower 48 bits
85}; // Information provider top 8 bits.
86
92
99const kXR_char XROOTD_MON_REDHOST = 0xf0; // No Modifier
101
102
105const kXR_char XROOTD_MON_MAPFSTA = 'f'; // The "f" stream
106const kXR_char XROOTD_MON_MAPGSTA = 'g'; // The "g" stream
108const kXR_char XROOTD_MON_MAPMIGR = 'm'; // Internal use only!
111const kXR_char XROOTD_MON_MAPSTAG = 's'; // Internal use only!
115const kXR_char XROOTD_MON_MAPUEAC = 'U'; // User experiment/activity
117
118const kXR_char XROOTD_MON_GSCCM = 'M'; // pfc: Cache context mgt info
119const kXR_char XROOTD_MON_GSPFC = 'C'; // pfc: Cache monitoring info
120const kXR_char XROOTD_MON_GSTCP = 'T'; // TCP connection statistics
121const kXR_char XROOTD_MON_GSTPC = 'P'; // TPC Third Party Copy
122const kXR_char XROOTD_MON_GSTHR = 'R'; // IO activity from the throttle plugin
123const kXR_char XROOTD_MON_GSOSS = 'O'; // IO activity from a generic OSS plugin
124const kXR_char XROOTD_MON_GSHTP = 'H'; // Request processing activity from HTTP protocol
125
126// The following bits are insert in the low order 4 bits of the MON_REDIRECT
127// entry code to indicate the actual operation that was requestded.
128//
129const kXR_char XROOTD_MON_REDSID = 0xf0; // Server Identification
130const kXR_char XROOTD_MON_REDTIME = 0x00; // Timing mark
131
132const kXR_char XROOTD_MON_REDIRECT = 0x80; // With Modifier below!
133const kXR_char XROOTD_MON_REDLOCAL = 0x90; // With Modifier below!
134
135const kXR_char XROOTD_MON_CHMOD = 0x01; // Modifiers for the above
149
152
153const int XROOTD_MON_REDMASK = 0x00000ff;
154const int XROOTD_MON_SRCMASK = 0x000000f;
155const int XROOTD_MON_TRGMASK = 0x7fffff0;
156const int XROOTD_MON_NEWSTID = 0x8000000;
157
158const long long XROOTD_MON_SIDMASK = 0x0000ffffffffffff;
159const long long XROOTD_MON_PIDMASK = 0xff;
160const long long XROOTD_MON_PIDSHFT = 56;
161
162/******************************************************************************/
163/* " f " S t r e a m S p e c i f i c R e c o r d s */
164/******************************************************************************/
165
166// The UDP buffer layout is as follows:
167//
168// XrdXrootdMonHeader with Code == XROOTD_MON_MAPFSTA
169// XrdXrootdMonFileTOD with recType == isTime
170// XrdXrootdMonFileHdr with recType == one of recTval (variable length)
171// ... additional XrdXrootdMonFileHdr's (variable length)
172// XrdXrootdMonFileTOD with recType == isTime
173
175{
176enum recTval {isClose = 0, // Record for close
177 isOpen, // Record for open
178 isTime, // Record for time
179 isXfr, // Record for transfers
180 isDisc // Record for disconnection
181 };
182
183enum recFval {forced =0x01, // If recFlag == isClose close due to disconnect
184 hasOPS =0x02, // If recFlag == isClose MonStatXFR + MonStatOPS
185 hasSSQ =0x04, // If recFlag == isClose XFR + OPS + MonStatSSQ
186 hasCSE =0x04, // If recFlag == isClose XFR + OPS + MonStatSSQ
187 hasLFN =0x01, // If recFlag == isOpen the lfn is present
188 hasRW =0x02, // If recFlag == isOpen file opened r/w
189 hasSID =0x01 // if recFlag == isTime sID is present (new rec)
190 };
191
192char recType; // RecTval: isClose | isOpen | isTime | isXfr
193char recFlag; // RecFval: Record type-specific flags
194short recSize; // Size of this record in bytes
195union
196{
197kXR_unt32 fileID; // dictid of file for all rectypes except "disc" & "time"
198kXR_unt32 userID; // dictid of user for rectypes equal "disc"
199short nRecs[2]; // isTime: nRecs[0] == isXfr recs nRecs[1] == total recs
200};
201};
202
203// The following record is always be present as the first record in the udp
204// udp packet and should be used to establish the recording window.
205//
207{
209int tBeg; // time(0) of following record
210int tEnd; // time(0) when packet was sent
211kXR_int64 sID; // Server id in lower 48 bits
212};
213
214
215// The following variable length structure exists in XrdXrootdMonFileOPN if
216// "lfn" has been specified. It exists only when recFlag & hasLFN is TRUE.
217// The user's dictid will be zero (missing) if user monitoring is not enabled.
218//
220{
221kXR_unt32 user; // Monitoring dictid for the user, may be 0.
222char lfn[1028];// Variable length, use recSize!
223};
224
225// The following is reported when a file is opened. If "lfn" was specified and
226// Hdr.recFlag & hasLFN is TRUE the XrdXrootdMonFileLFN structure is present.
227// However, it variable in size and the next record will be found using recSize.
228// The lfn is gauranteed to end with at least one null byte.
229//
231{
233long long fsz; // 8 file size at time of open
234XrdXrootdMonFileLFN ufn; // Present ONLY if recFlag & hasLFN is TRUE
235};
236
237// The following data is collected on a per file basis
238//
239struct XrdXrootdMonStatPRW // 8 Bytes
240{
241long long rBytes; // Bytes read from file so far using pgread()
242int rCount; // Number of operations
243int rRetry; // Number of pgread retries (pages)
244long long wBytes; // Bytes written to file so far using pgwrite()
245int wCount; // Number of operations
246int wRetry; // Number of pgwrite retries (corrections)
247int wcsErr; // Number of pgwrite checksum errors
248int wcsUnc; // Number of pgwrite uncorrected checksums
249};
250
251struct XrdXrootdMonStatOPS // 48 Bytes
252{
253int read; // Number of read() calls
254int readv; // Number of readv() calls
255int write; // Number of write() calls
256short rsMin; // Smallest readv() segment count
257short rsMax; // Largest readv() segment count
258long long rsegs; // Number of readv() segments
259int rdMin; // Smallest read() request size
260int rdMax; // Largest read() request size
261int rvMin; // Smallest readv() request size
262int rvMax; // Largest readv() request size
263int wrMin; // Smallest write() request size
264int wrMax; // Largest write() request size
265};
266
268{
269long long dlong;
270double dreal;
271};
272
273struct XrdXrootdMonStatSSQ // 32 Bytes (all values net ordered IEEE754)
274{
275XrdXrootdMonDouble read; // Sum (all read requests)**2 (size)
276XrdXrootdMonDouble readv; // Sum (all readv requests)**2 (size as a unit)
277XrdXrootdMonDouble rsegs; // Sum (all readv segments)**2 (count as a unit)
278XrdXrootdMonDouble write; // Sum (all write requests)**2 (size)
279};
280
281// The following transfer data is collected for each open file.
282//
284{
285long long read; // Bytes read from file so far using read()
286long long readv; // Bytes read from file so far using readv()
287long long write; // Bytes written to file so far
288};
289
290// The following is reported upon file close. This is a variable length record.
291// The record always contains XrdXrootdMonStatXFR after XrdXrootdMonFileHdr.
292// If (recFlag & hasOPS) TRUE XrdXrootdMonStatOPS follows XrdXrootdMonStatXFR
293// If (recFlag & hasSSQ) TRUE XrdXrootdMonStatSQV follows XrdXrootdMonStatOPS
294// The XrdXrootdMonStatSSQ information is present only if "ssq" was specified.
295//
296struct XrdXrootdMonFileCLS // 32 | 80 | 96 Bytes
297{
298XrdXrootdMonFileHdr Hdr; // Always present (recSize has full length)
299XrdXrootdMonStatXFR Xfr; // Always present
300XrdXrootdMonStatOPS Ops; // Only present when (recFlag & hasOPS) is True
301XrdXrootdMonStatSSQ Ssq; // Only present when (recFlag & hasSSQ) is True
302};
303
304// The following is reported when a user ends a session.
305//
310
311// The following is reported each interval*count for each open file when "xfr"
312// is specified. These records may be interspersed with other records.
313//
314struct XrdXrootdMonFileXFR // 32 Bytes
315{
316XrdXrootdMonFileHdr Hdr; // Always present with recType == isXFR
317XrdXrootdMonStatXFR Xfr; // Always present
318};
319#endif
long long kXR_int64
Definition XPtypes.hh:98
int kXR_int32
Definition XPtypes.hh:89
unsigned int kXR_unt32
Definition XPtypes.hh:90
short kXR_int16
Definition XPtypes.hh:66
unsigned short kXR_unt16
Definition XPtypes.hh:67
unsigned char kXR_char
Definition XPtypes.hh:65
const kXR_char XROOTD_MON_OPENW
const kXR_char XROOTD_MON_GSTPC
const kXR_char XROOTD_MON_STAT
const long long XROOTD_MON_PIDSHFT
const kXR_char XROOTD_MON_REDLOCAL
const kXR_char XROOTD_MON_GSTCP
XrdXrootdMonHeader hdr
const kXR_char XROOTD_MON_DISC
const kXR_char XROOTD_MON_MAPUEAC
const kXR_char XROOTD_MON_WINDOW
const kXR_char XROOTD_MON_READV
union XrdXrootdMonTrace::@071201375064112304113254232042147015044310104340 arg2
const kXR_char XROOTD_MON_MAPGSTA
XrdXrootdMonDouble write
const int XROOTD_MON_SRCMASK
XrdXrootdMonTrace info[sizeof(XrdXrootdMonTrace)]
const kXR_char XROOTD_MON_PREP
const int XROOTD_MON_NEWSTID
const kXR_char XROOTD_MON_MAPUSER
XrdXrootdMonFileHdr Hdr
const kXR_char XROOTD_MON_APPID
union XrdXrootdMonTrace::@352045303064014077344306140330334306371123333056 arg0
const kXR_char XROOTD_MON_MAPINFO
const kXR_char XROOTD_MON_OPENC
const kXR_char XROOTD_MON_TRUNC
const kXR_char XROOTD_MON_REDSID
const kXR_char XROOTD_MON_GSHTP
XrdXrootdMonFileLFN ufn
XrdXrootdMonDouble read
const kXR_char XROOTD_MON_MAPIDNT
XrdXrootdMonStatXFR Xfr
const kXR_char XROOTD_MON_MAPTRCE
const kXR_char XROOTD_MON_MAPXFER
const kXR_char XROOTD_MON_BOUNDP
XrdXrootdMonDouble readv
union XrdXrootdMonRedir::@017044370107177241030156067342362323316131075335 arg0
const long long XROOTD_MON_SIDMASK
const kXR_char XROOTD_MON_GSOSS
const kXR_char XROOTD_MON_MAPMIGR
char info[1024+256]
const kXR_char XROOTD_MON_CLOSE
const kXR_char XROOTD_MON_CHMOD
const kXR_char XROOTD_MON_FORCED
XrdXrootdMonStatXFR Xfr
const kXR_char XROOTD_MON_MAPPATH
const kXR_char XROOTD_MON_LOCATE
const kXR_char XROOTD_MON_MAPSTAG
XrdXrootdMonFileHdr Hdr
const kXR_char XROOTD_MON_GSCCM
XrdXrootdMonStatOPS Ops
union XrdXrootdMonRedir::@124330332126055120131203275034312305071227313005 arg1
const kXR_char XROOTD_MON_OPENR
const kXR_char XROOTD_MON_REDTIME
XrdXrootdMonHeader hdr
const int XROOTD_MON_TRGMASK
const long long XROOTD_MON_PIDMASK
const kXR_char XROOTD_MON_OPEN
XrdXrootdMonHeader hdr
const kXR_char XROOTD_MON_MV
const int XROOTD_MON_REDMASK
const kXR_char XROOTD_MON_MAPFSTA
const kXR_char XROOTD_MON_REDIRECT
XrdXrootdMonRedir info[sizeof(XrdXrootdMonRedir)]
XrdXrootdMonHeader hdr
XrdXrootdMonFileHdr Hdr
const kXR_char XROOTD_MON_RMDIR
const kXR_char XROOTD_MON_MAPTOKN
const kXR_char XROOTD_MON_GSTHR
const kXR_char XROOTD_MON_GSPFC
const kXR_char XROOTD_MON_RM
const kXR_char XROOTD_MON_OPENDIR
const kXR_char XROOTD_MON_REDHOST
XrdXrootdMonFileHdr Hdr
union XrdXrootdMonTrace::@242174165006057331072121011256323010344226151256 arg1
XrdXrootdMonDouble rsegs
const kXR_char XROOTD_MON_MAPPURG
const kXR_char XROOTD_MON_MAPREDR
XrdXrootdMonStatSSQ Ssq
XrdXrootdMonFileHdr Hdr
const kXR_char XROOTD_MON_QUERY
const kXR_char XROOTD_MON_MKDIR
const kXR_char XROOTD_MON_READU