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];
56 };
57
60 XrdXrootdMonTrace info[sizeof(XrdXrootdMonTrace)]; //This is really [n]
61 };
62
65 struct {kXR_char Type;
68 } rdr; } arg0;
71 };
72
75 union {kXR_int64 sID;
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
90 char info[1024+256];
91 };
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!
114const kXR_char XROOTD_MON_MAPUEAC = 'U'; // User experiment/activity
116
117const kXR_char XROOTD_MON_GSCCM = 'M'; // pfc: Cache context mgt info
118const kXR_char XROOTD_MON_GSPFC = 'C'; // pfc: Cache monitoring info
119const kXR_char XROOTD_MON_GSTCP = 'T'; // TCP connection statistics
120const kXR_char XROOTD_MON_GSTPC = 'P'; // TPC Third Party Copy
121
122// The following bits are insert in the low order 4 bits of the MON_REDIRECT
123// entry code to indicate the actual operation that was requestded.
124//
125const kXR_char XROOTD_MON_REDSID = 0xf0; // Server Identification
126const kXR_char XROOTD_MON_REDTIME = 0x00; // Timing mark
127
128const kXR_char XROOTD_MON_REDIRECT = 0x80; // With Modifier below!
129const kXR_char XROOTD_MON_REDLOCAL = 0x90; // With Modifier below!
130
131const kXR_char XROOTD_MON_CHMOD = 0x01; // Modifiers for the above
145
148
149const int XROOTD_MON_REDMASK = 0x00000ff;
150const int XROOTD_MON_SRCMASK = 0x000000f;
151const int XROOTD_MON_TRGMASK = 0x7fffff0;
152const int XROOTD_MON_NEWSTID = 0x8000000;
153
154const long long XROOTD_MON_SIDMASK = 0x0000ffffffffffff;
155const long long XROOTD_MON_PIDMASK = 0xff;
156const long long XROOTD_MON_PIDSHFT = 56;
157
158/******************************************************************************/
159/* " f " S t r e a m S p e c i f i c R e c o r d s */
160/******************************************************************************/
161
162// The UDP buffer layout is as follows:
163//
164// XrdXrootdMonHeader with Code == XROOTD_MON_MAPFSTA
165// XrdXrootdMonFileTOD with recType == isTime
166// XrdXrootdMonFileHdr with recType == one of recTval (variable length)
167// ... additional XrdXrootdMonFileHdr's (variable length)
168// XrdXrootdMonFileTOD with recType == isTime
169
171{
172enum recTval {isClose = 0, // Record for close
173 isOpen, // Record for open
174 isTime, // Record for time
175 isXfr, // Record for transfers
176 isDisc // Record for disconnection
177 };
178
179enum recFval {forced =0x01, // If recFlag == isClose close due to disconnect
180 hasOPS =0x02, // If recFlag == isClose MonStatXFR + MonStatOPS
181 hasSSQ =0x04, // If recFlag == isClose XFR + OPS + MonStatSSQ
182 hasCSE =0x04, // If recFlag == isClose XFR + OPS + MonStatSSQ
183 hasLFN =0x01, // If recFlag == isOpen the lfn is present
184 hasRW =0x02, // If recFlag == isOpen file opened r/w
185 hasSID =0x01 // if recFlag == isTime sID is present (new rec)
186 };
187
188char recType; // RecTval: isClose | isOpen | isTime | isXfr
189char recFlag; // RecFval: Record type-specific flags
190short recSize; // Size of this record in bytes
191union
192{
193kXR_unt32 fileID; // dictid of file for all rectypes except "disc" & "time"
194kXR_unt32 userID; // dictid of user for rectypes equal "disc"
195short nRecs[2]; // isTime: nRecs[0] == isXfr recs nRecs[1] == total recs
196};
197};
198
199// The following record is always be present as the first record in the udp
200// udp packet and should be used to establish the recording window.
201//
203{
205int tBeg; // time(0) of following record
206int tEnd; // time(0) when packet was sent
207kXR_int64 sID; // Server id in lower 48 bits
208};
209
210
211// The following variable length structure exists in XrdXrootdMonFileOPN if
212// "lfn" has been specified. It exists only when recFlag & hasLFN is TRUE.
213// The user's dictid will be zero (missing) if user monitoring is not enabled.
214//
216{
217kXR_unt32 user; // Monitoring dictid for the user, may be 0.
218char lfn[1028];// Variable length, use recSize!
219};
220
221// The following is reported when a file is opened. If "lfn" was specified and
222// Hdr.recFlag & hasLFN is TRUE the XrdXrootdMonFileLFN structure is present.
223// However, it variable in size and the next record will be found using recSize.
224// The lfn is gauranteed to end with at least one null byte.
225//
227{
229long long fsz; // 8 file size at time of open
230XrdXrootdMonFileLFN ufn; // Present ONLY if recFlag & hasLFN is TRUE
231};
232
233// The following data is collected on a per file basis
234//
235struct XrdXrootdMonStatPRW // 8 Bytes
236{
237long long rBytes; // Bytes read from file so far using pgread()
238int rCount; // Number of operations
239int rRetry; // Number of pgread retries (pages)
240long long wBytes; // Bytes written to file so far using pgwrite()
241int wCount; // Number of operations
242int wRetry; // Number of pgwrite retries (corrections)
243int wcsErr; // Number of pgwrite checksum errors
244int wcsUnc; // Number of pgwrite uncorrected checksums
245};
246
247struct XrdXrootdMonStatOPS // 48 Bytes
248{
249int read; // Number of read() calls
250int readv; // Number of readv() calls
251int write; // Number of write() calls
252short rsMin; // Smallest readv() segment count
253short rsMax; // Largest readv() segment count
254long long rsegs; // Number of readv() segments
255int rdMin; // Smallest read() request size
256int rdMax; // Largest read() request size
257int rvMin; // Smallest readv() request size
258int rvMax; // Largest readv() request size
259int wrMin; // Smallest write() request size
260int wrMax; // Largest write() request size
261};
262
264{
265long long dlong;
266double dreal;
267};
268
269struct XrdXrootdMonStatSSQ // 32 Bytes (all values net ordered IEEE754)
270{
271XrdXrootdMonDouble read; // Sum (all read requests)**2 (size)
272XrdXrootdMonDouble readv; // Sum (all readv requests)**2 (size as a unit)
273XrdXrootdMonDouble rsegs; // Sum (all readv segments)**2 (count as a unit)
274XrdXrootdMonDouble write; // Sum (all write requests)**2 (size)
275};
276
277// The following transfer data is collected for each open file.
278//
280{
281long long read; // Bytes read from file so far using read()
282long long readv; // Bytes read from file so far using readv()
283long long write; // Bytes written to file so far
284};
285
286// The following is reported upon file close. This is a variable length record.
287// The record always contains XrdXrootdMonStatXFR after XrdXrootdMonFileHdr.
288// If (recFlag & hasOPS) TRUE XrdXrootdMonStatOPS follows XrdXrootdMonStatXFR
289// If (recFlag & hasSSQ) TRUE XrdXrootdMonStatSQV follows XrdXrootdMonStatOPS
290// The XrdXrootdMonStatSSQ information is present only if "ssq" was specified.
291//
292struct XrdXrootdMonFileCLS // 32 | 80 | 96 Bytes
293{
294XrdXrootdMonFileHdr Hdr; // Always present (recSize has full length)
295XrdXrootdMonStatXFR Xfr; // Always present
296XrdXrootdMonStatOPS Ops; // Only present when (recFlag & hasOPS) is True
297XrdXrootdMonStatSSQ Ssq; // Only present when (recFlag & hasSSQ) is True
298};
299
300// The following is reported when a user ends a session.
301//
303{
305};
306
307// The following is reported each interval*count for each open file when "xfr"
308// is specified. These records may be interspersed with other records.
309//
310struct XrdXrootdMonFileXFR // 32 Bytes
311{
312XrdXrootdMonFileHdr Hdr; // Always present with recType == isXFR
313XrdXrootdMonStatXFR Xfr; // Always present
314};
315#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
Definition: XrdXrootdMonData.hh:136
const kXR_char XROOTD_MON_GSTPC
Definition: XrdXrootdMonData.hh:120
const kXR_char XROOTD_MON_STAT
Definition: XrdXrootdMonData.hh:143
const long long XROOTD_MON_PIDSHFT
Definition: XrdXrootdMonData.hh:156
const kXR_char XROOTD_MON_REDLOCAL
Definition: XrdXrootdMonData.hh:129
const kXR_char XROOTD_MON_GSTCP
Definition: XrdXrootdMonData.hh:119
const kXR_char XROOTD_MON_DISC
Definition: XrdXrootdMonData.hh:95
const kXR_char XROOTD_MON_MAPUEAC
Definition: XrdXrootdMonData.hh:114
const kXR_char XROOTD_MON_WINDOW
Definition: XrdXrootdMonData.hh:100
const kXR_char XROOTD_MON_READV
Definition: XrdXrootdMonData.hh:97
const kXR_char XROOTD_MON_MAPGSTA
Definition: XrdXrootdMonData.hh:106
const int XROOTD_MON_SRCMASK
Definition: XrdXrootdMonData.hh:150
const kXR_char XROOTD_MON_PREP
Definition: XrdXrootdMonData.hh:139
const int XROOTD_MON_NEWSTID
Definition: XrdXrootdMonData.hh:152
const kXR_char XROOTD_MON_MAPUSER
Definition: XrdXrootdMonData.hh:113
const kXR_char XROOTD_MON_APPID
Definition: XrdXrootdMonData.hh:93
const kXR_char XROOTD_MON_MAPINFO
Definition: XrdXrootdMonData.hh:107
const kXR_char XROOTD_MON_OPENC
Definition: XrdXrootdMonData.hh:134
const kXR_char XROOTD_MON_TRUNC
Definition: XrdXrootdMonData.hh:144
const kXR_char XROOTD_MON_REDSID
Definition: XrdXrootdMonData.hh:125
const kXR_char XROOTD_MON_MAPIDNT
Definition: XrdXrootdMonData.hh:103
const kXR_char XROOTD_MON_MAPTRCE
Definition: XrdXrootdMonData.hh:112
const kXR_char XROOTD_MON_MAPXFER
Definition: XrdXrootdMonData.hh:115
const kXR_char XROOTD_MON_BOUNDP
Definition: XrdXrootdMonData.hh:147
const long long XROOTD_MON_SIDMASK
Definition: XrdXrootdMonData.hh:154
const kXR_char XROOTD_MON_MAPMIGR
Definition: XrdXrootdMonData.hh:108
const kXR_char XROOTD_MON_CLOSE
Definition: XrdXrootdMonData.hh:94
const kXR_char XROOTD_MON_CHMOD
Definition: XrdXrootdMonData.hh:131
const kXR_char XROOTD_MON_FORCED
Definition: XrdXrootdMonData.hh:146
const kXR_char XROOTD_MON_MAPPATH
Definition: XrdXrootdMonData.hh:104
const kXR_char XROOTD_MON_LOCATE
Definition: XrdXrootdMonData.hh:132
const kXR_char XROOTD_MON_MAPSTAG
Definition: XrdXrootdMonData.hh:111
const kXR_char XROOTD_MON_GSCCM
Definition: XrdXrootdMonData.hh:117
const kXR_char XROOTD_MON_OPENR
Definition: XrdXrootdMonData.hh:135
const kXR_char XROOTD_MON_REDTIME
Definition: XrdXrootdMonData.hh:126
const int XROOTD_MON_TRGMASK
Definition: XrdXrootdMonData.hh:151
const long long XROOTD_MON_PIDMASK
Definition: XrdXrootdMonData.hh:155
const kXR_char XROOTD_MON_OPEN
Definition: XrdXrootdMonData.hh:96
const kXR_char XROOTD_MON_MV
Definition: XrdXrootdMonData.hh:138
const int XROOTD_MON_REDMASK
Definition: XrdXrootdMonData.hh:149
const kXR_char XROOTD_MON_MAPFSTA
Definition: XrdXrootdMonData.hh:105
const kXR_char XROOTD_MON_REDIRECT
Definition: XrdXrootdMonData.hh:128
const kXR_char XROOTD_MON_RMDIR
Definition: XrdXrootdMonData.hh:142
const kXR_char XROOTD_MON_GSPFC
Definition: XrdXrootdMonData.hh:118
const kXR_char XROOTD_MON_RM
Definition: XrdXrootdMonData.hh:141
const kXR_char XROOTD_MON_OPENDIR
Definition: XrdXrootdMonData.hh:133
const kXR_char XROOTD_MON_REDHOST
Definition: XrdXrootdMonData.hh:99
const kXR_char XROOTD_MON_MAPPURG
Definition: XrdXrootdMonData.hh:109
const kXR_char XROOTD_MON_MAPREDR
Definition: XrdXrootdMonData.hh:110
const kXR_char XROOTD_MON_QUERY
Definition: XrdXrootdMonData.hh:140
const kXR_char XROOTD_MON_MKDIR
Definition: XrdXrootdMonData.hh:137
const kXR_char XROOTD_MON_READU
Definition: XrdXrootdMonData.hh:98
Definition: XrdXrootdMonData.hh:59
XrdXrootdMonTrace info[sizeof(XrdXrootdMonTrace)]
Definition: XrdXrootdMonData.hh:60
XrdXrootdMonHeader hdr
Definition: XrdXrootdMonData.hh:59
Definition: XrdXrootdMonData.hh:74
kXR_char sXX[8]
Definition: XrdXrootdMonData.hh:76
XrdXrootdMonHeader hdr
Definition: XrdXrootdMonData.hh:74
kXR_int64 sID
Definition: XrdXrootdMonData.hh:75
XrdXrootdMonRedir info[sizeof(XrdXrootdMonRedir)]
Definition: XrdXrootdMonData.hh:77
Definition: XrdXrootdMonData.hh:293
XrdXrootdMonStatXFR Xfr
Definition: XrdXrootdMonData.hh:295
XrdXrootdMonStatOPS Ops
Definition: XrdXrootdMonData.hh:296
XrdXrootdMonStatSSQ Ssq
Definition: XrdXrootdMonData.hh:297
XrdXrootdMonFileHdr Hdr
Definition: XrdXrootdMonData.hh:294
Definition: XrdXrootdMonData.hh:303
XrdXrootdMonFileHdr Hdr
Definition: XrdXrootdMonData.hh:304
Definition: XrdXrootdMonData.hh:171
kXR_unt32 userID
Definition: XrdXrootdMonData.hh:194
kXR_unt32 fileID
Definition: XrdXrootdMonData.hh:193
short nRecs[2]
Definition: XrdXrootdMonData.hh:195
short recSize
Definition: XrdXrootdMonData.hh:190
char recType
Definition: XrdXrootdMonData.hh:188
recTval
Definition: XrdXrootdMonData.hh:172
@ isDisc
Definition: XrdXrootdMonData.hh:176
@ isXfr
Definition: XrdXrootdMonData.hh:175
@ isTime
Definition: XrdXrootdMonData.hh:174
@ isOpen
Definition: XrdXrootdMonData.hh:173
@ isClose
Definition: XrdXrootdMonData.hh:172
char recFlag
Definition: XrdXrootdMonData.hh:189
recFval
Definition: XrdXrootdMonData.hh:179
@ hasRW
Definition: XrdXrootdMonData.hh:184
@ hasOPS
Definition: XrdXrootdMonData.hh:180
@ forced
Definition: XrdXrootdMonData.hh:179
@ hasLFN
Definition: XrdXrootdMonData.hh:183
@ hasSSQ
Definition: XrdXrootdMonData.hh:181
@ hasCSE
Definition: XrdXrootdMonData.hh:182
@ hasSID
Definition: XrdXrootdMonData.hh:185
Definition: XrdXrootdMonData.hh:216
char lfn[1028]
Definition: XrdXrootdMonData.hh:218
kXR_unt32 user
Definition: XrdXrootdMonData.hh:217
Definition: XrdXrootdMonData.hh:227
XrdXrootdMonFileLFN ufn
Definition: XrdXrootdMonData.hh:230
long long fsz
Definition: XrdXrootdMonData.hh:229
XrdXrootdMonFileHdr Hdr
Definition: XrdXrootdMonData.hh:228
Definition: XrdXrootdMonData.hh:203
XrdXrootdMonFileHdr Hdr
Definition: XrdXrootdMonData.hh:204
int tBeg
Definition: XrdXrootdMonData.hh:205
int tEnd
Definition: XrdXrootdMonData.hh:206
kXR_int64 sID
Definition: XrdXrootdMonData.hh:207
Definition: XrdXrootdMonData.hh:311
XrdXrootdMonStatXFR Xfr
Definition: XrdXrootdMonData.hh:313
XrdXrootdMonFileHdr Hdr
Definition: XrdXrootdMonData.hh:312
Definition: XrdXrootdMonData.hh:81
int tEnd
Definition: XrdXrootdMonData.hh:83
int tBeg
Definition: XrdXrootdMonData.hh:82
XrdXrootdMonHeader hdr
Definition: XrdXrootdMonData.hh:81
kXR_int64 sID
Definition: XrdXrootdMonData.hh:84
Definition: XrdXrootdMonData.hh:40
kXR_int32 stod
Definition: XrdXrootdMonData.hh:43
kXR_unt16 plen
Definition: XrdXrootdMonData.hh:42
kXR_char pseq
Definition: XrdXrootdMonData.hh:41
kXR_char code
Definition: XrdXrootdMonData.hh:40
Definition: XrdXrootdMonData.hh:88
kXR_unt32 dictid
Definition: XrdXrootdMonData.hh:89
char info[1024+256]
Definition: XrdXrootdMonData.hh:90
XrdXrootdMonHeader hdr
Definition: XrdXrootdMonData.hh:88
Definition: XrdXrootdMonData.hh:64
kXR_char Type
Definition: XrdXrootdMonData.hh:65
union XrdXrootdMonRedir::@162 arg0
kXR_unt32 dictid
Definition: XrdXrootdMonData.hh:69
kXR_int32 Window
Definition: XrdXrootdMonData.hh:64
union XrdXrootdMonRedir::@163 arg1
kXR_int16 Port
Definition: XrdXrootdMonData.hh:67
struct XrdXrootdMonRedir::@162::@164 rdr
kXR_char Dent
Definition: XrdXrootdMonData.hh:66
Definition: XrdXrootdMonData.hh:248
long long rsegs
Definition: XrdXrootdMonData.hh:254
short rsMax
Definition: XrdXrootdMonData.hh:253
int rvMax
Definition: XrdXrootdMonData.hh:258
int write
Definition: XrdXrootdMonData.hh:251
int read
Definition: XrdXrootdMonData.hh:249
int rvMin
Definition: XrdXrootdMonData.hh:257
int rdMax
Definition: XrdXrootdMonData.hh:256
int wrMin
Definition: XrdXrootdMonData.hh:259
short rsMin
Definition: XrdXrootdMonData.hh:252
int wrMax
Definition: XrdXrootdMonData.hh:260
int rdMin
Definition: XrdXrootdMonData.hh:255
int readv
Definition: XrdXrootdMonData.hh:250
Definition: XrdXrootdMonData.hh:236
int wCount
Definition: XrdXrootdMonData.hh:241
long long wBytes
Definition: XrdXrootdMonData.hh:240
int wRetry
Definition: XrdXrootdMonData.hh:242
int wcsErr
Definition: XrdXrootdMonData.hh:243
int rCount
Definition: XrdXrootdMonData.hh:238
long long rBytes
Definition: XrdXrootdMonData.hh:237
int wcsUnc
Definition: XrdXrootdMonData.hh:244
int rRetry
Definition: XrdXrootdMonData.hh:239
Definition: XrdXrootdMonData.hh:270
XrdXrootdMonDouble write
Definition: XrdXrootdMonData.hh:274
XrdXrootdMonDouble read
Definition: XrdXrootdMonData.hh:271
XrdXrootdMonDouble readv
Definition: XrdXrootdMonData.hh:272
XrdXrootdMonDouble rsegs
Definition: XrdXrootdMonData.hh:273
Definition: XrdXrootdMonData.hh:280
long long readv
Definition: XrdXrootdMonData.hh:282
long long read
Definition: XrdXrootdMonData.hh:281
long long write
Definition: XrdXrootdMonData.hh:283
Definition: XrdXrootdMonData.hh:47
union XrdXrootdMonTrace::@160 arg1
kXR_int64 val
Definition: XrdXrootdMonData.hh:47
kXR_unt32 rTot[2]
Definition: XrdXrootdMonData.hh:50
union XrdXrootdMonTrace::@159 arg0
kXR_int32 buflen
Definition: XrdXrootdMonData.hh:51
kXR_int32 Window
Definition: XrdXrootdMonData.hh:52
kXR_unt16 sVal[4]
Definition: XrdXrootdMonData.hh:49
kXR_unt32 dictid
Definition: XrdXrootdMonData.hh:54
union XrdXrootdMonTrace::@161 arg2
kXR_unt32 wTot
Definition: XrdXrootdMonData.hh:53
Definition: XrdXrootdMonData.hh:264
long long dlong
Definition: XrdXrootdMonData.hh:265
double dreal
Definition: XrdXrootdMonData.hh:266