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;
51 union {kXR_int32 buflen;
52 kXR_int32 Window;
53 kXR_unt32 wTot; } arg1;
54 union {kXR_unt32 dictid;
55 kXR_int32 Window; } arg2;
56 };
57
62
64 {union {kXR_int32 Window;
65 struct {kXR_char Type;
66 kXR_char Dent;
67 kXR_int16 Port;
68 } rdr; } arg0;
69 union {kXR_unt32 dictid;
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
123
124// The following bits are insert in the low order 4 bits of the MON_REDIRECT
125// entry code to indicate the actual operation that was requestded.
126//
127const kXR_char XROOTD_MON_REDSID = 0xf0; // Server Identification
128const kXR_char XROOTD_MON_REDTIME = 0x00; // Timing mark
129
130const kXR_char XROOTD_MON_REDIRECT = 0x80; // With Modifier below!
131const kXR_char XROOTD_MON_REDLOCAL = 0x90; // With Modifier below!
132
133const kXR_char XROOTD_MON_CHMOD = 0x01; // Modifiers for the above
147
150
151const int XROOTD_MON_REDMASK = 0x00000ff;
152const int XROOTD_MON_SRCMASK = 0x000000f;
153const int XROOTD_MON_TRGMASK = 0x7fffff0;
154const int XROOTD_MON_NEWSTID = 0x8000000;
155
156const long long XROOTD_MON_SIDMASK = 0x0000ffffffffffff;
157const long long XROOTD_MON_PIDMASK = 0xff;
158const long long XROOTD_MON_PIDSHFT = 56;
159
160/******************************************************************************/
161/* " f " S t r e a m S p e c i f i c R e c o r d s */
162/******************************************************************************/
163
164// The UDP buffer layout is as follows:
165//
166// XrdXrootdMonHeader with Code == XROOTD_MON_MAPFSTA
167// XrdXrootdMonFileTOD with recType == isTime
168// XrdXrootdMonFileHdr with recType == one of recTval (variable length)
169// ... additional XrdXrootdMonFileHdr's (variable length)
170// XrdXrootdMonFileTOD with recType == isTime
171
173{
174enum recTval {isClose = 0, // Record for close
175 isOpen, // Record for open
176 isTime, // Record for time
177 isXfr, // Record for transfers
178 isDisc // Record for disconnection
179 };
180
181enum recFval {forced =0x01, // If recFlag == isClose close due to disconnect
182 hasOPS =0x02, // If recFlag == isClose MonStatXFR + MonStatOPS
183 hasSSQ =0x04, // If recFlag == isClose XFR + OPS + MonStatSSQ
184 hasCSE =0x04, // If recFlag == isClose XFR + OPS + MonStatSSQ
185 hasLFN =0x01, // If recFlag == isOpen the lfn is present
186 hasRW =0x02, // If recFlag == isOpen file opened r/w
187 hasSID =0x01 // if recFlag == isTime sID is present (new rec)
188 };
189
190char recType; // RecTval: isClose | isOpen | isTime | isXfr
191char recFlag; // RecFval: Record type-specific flags
192short recSize; // Size of this record in bytes
193union
194{
195kXR_unt32 fileID; // dictid of file for all rectypes except "disc" & "time"
196kXR_unt32 userID; // dictid of user for rectypes equal "disc"
197short nRecs[2]; // isTime: nRecs[0] == isXfr recs nRecs[1] == total recs
198};
199};
200
201// The following record is always be present as the first record in the udp
202// udp packet and should be used to establish the recording window.
203//
205{
207int tBeg; // time(0) of following record
208int tEnd; // time(0) when packet was sent
209kXR_int64 sID; // Server id in lower 48 bits
210};
211
212
213// The following variable length structure exists in XrdXrootdMonFileOPN if
214// "lfn" has been specified. It exists only when recFlag & hasLFN is TRUE.
215// The user's dictid will be zero (missing) if user monitoring is not enabled.
216//
218{
219kXR_unt32 user; // Monitoring dictid for the user, may be 0.
220char lfn[1028];// Variable length, use recSize!
221};
222
223// The following is reported when a file is opened. If "lfn" was specified and
224// Hdr.recFlag & hasLFN is TRUE the XrdXrootdMonFileLFN structure is present.
225// However, it variable in size and the next record will be found using recSize.
226// The lfn is gauranteed to end with at least one null byte.
227//
229{
231long long fsz; // 8 file size at time of open
232XrdXrootdMonFileLFN ufn; // Present ONLY if recFlag & hasLFN is TRUE
233};
234
235// The following data is collected on a per file basis
236//
237struct XrdXrootdMonStatPRW // 8 Bytes
238{
239long long rBytes; // Bytes read from file so far using pgread()
240int rCount; // Number of operations
241int rRetry; // Number of pgread retries (pages)
242long long wBytes; // Bytes written to file so far using pgwrite()
243int wCount; // Number of operations
244int wRetry; // Number of pgwrite retries (corrections)
245int wcsErr; // Number of pgwrite checksum errors
246int wcsUnc; // Number of pgwrite uncorrected checksums
247};
248
249struct XrdXrootdMonStatOPS // 48 Bytes
250{
251int read; // Number of read() calls
252int readv; // Number of readv() calls
253int write; // Number of write() calls
254short rsMin; // Smallest readv() segment count
255short rsMax; // Largest readv() segment count
256long long rsegs; // Number of readv() segments
257int rdMin; // Smallest read() request size
258int rdMax; // Largest read() request size
259int rvMin; // Smallest readv() request size
260int rvMax; // Largest readv() request size
261int wrMin; // Smallest write() request size
262int wrMax; // Largest write() request size
263};
264
266{
267long long dlong;
268double dreal;
269};
270
271struct XrdXrootdMonStatSSQ // 32 Bytes (all values net ordered IEEE754)
272{
273XrdXrootdMonDouble read; // Sum (all read requests)**2 (size)
274XrdXrootdMonDouble readv; // Sum (all readv requests)**2 (size as a unit)
275XrdXrootdMonDouble rsegs; // Sum (all readv segments)**2 (count as a unit)
276XrdXrootdMonDouble write; // Sum (all write requests)**2 (size)
277};
278
279// The following transfer data is collected for each open file.
280//
282{
283long long read; // Bytes read from file so far using read()
284long long readv; // Bytes read from file so far using readv()
285long long write; // Bytes written to file so far
286};
287
288// The following is reported upon file close. This is a variable length record.
289// The record always contains XrdXrootdMonStatXFR after XrdXrootdMonFileHdr.
290// If (recFlag & hasOPS) TRUE XrdXrootdMonStatOPS follows XrdXrootdMonStatXFR
291// If (recFlag & hasSSQ) TRUE XrdXrootdMonStatSQV follows XrdXrootdMonStatOPS
292// The XrdXrootdMonStatSSQ information is present only if "ssq" was specified.
293//
294struct XrdXrootdMonFileCLS // 32 | 80 | 96 Bytes
295{
296XrdXrootdMonFileHdr Hdr; // Always present (recSize has full length)
297XrdXrootdMonStatXFR Xfr; // Always present
298XrdXrootdMonStatOPS Ops; // Only present when (recFlag & hasOPS) is True
299XrdXrootdMonStatSSQ Ssq; // Only present when (recFlag & hasSSQ) is True
300};
301
302// The following is reported when a user ends a session.
303//
308
309// The following is reported each interval*count for each open file when "xfr"
310// is specified. These records may be interspersed with other records.
311//
312struct XrdXrootdMonFileXFR // 32 Bytes
313{
314XrdXrootdMonFileHdr Hdr; // Always present with recType == isXFR
315XrdXrootdMonStatXFR Xfr; // Always present
316};
317#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::@170 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
const kXR_char XROOTD_MON_MAPINFO
const kXR_char XROOTD_MON_OPENC
const kXR_char XROOTD_MON_TRUNC
const kXR_char XROOTD_MON_REDSID
union XrdXrootdMonRedir::@174 arg1
XrdXrootdMonFileLFN ufn
XrdXrootdMonDouble read
const kXR_char XROOTD_MON_MAPIDNT
XrdXrootdMonStatXFR Xfr
const kXR_char XROOTD_MON_MAPTRCE
const kXR_char XROOTD_MON_MAPXFER
union XrdXrootdMonTrace::@169 arg1
const kXR_char XROOTD_MON_BOUNDP
XrdXrootdMonDouble readv
const long long XROOTD_MON_SIDMASK
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
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
union XrdXrootdMonRedir::@172 arg0
const kXR_char XROOTD_MON_REDHOST
XrdXrootdMonFileHdr Hdr
XrdXrootdMonDouble rsegs
const kXR_char XROOTD_MON_MAPPURG
const kXR_char XROOTD_MON_MAPREDR
union XrdXrootdMonTrace::@168 arg0
XrdXrootdMonStatSSQ Ssq
XrdXrootdMonFileHdr Hdr
const kXR_char XROOTD_MON_QUERY
const kXR_char XROOTD_MON_MKDIR
const kXR_char XROOTD_MON_READU