xrootd
Main Page
Namespaces
Classes
Files
File List
File Members
src
XrdXrootd
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
39
struct
XrdXrootdMonHeader
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
46
struct
XrdXrootdMonTrace
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
58
struct
XrdXrootdMonBuff
59
{
XrdXrootdMonHeader
hdr
;
60
XrdXrootdMonTrace
info
[
sizeof
(
XrdXrootdMonTrace
)];
//This is really [n]
61
};
62
63
struct
XrdXrootdMonRedir
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
73
struct
XrdXrootdMonBurr
74
{
XrdXrootdMonHeader
hdr
;
75
union
{
kXR_int64
sID
;
76
kXR_char
sXX
[8]; };
77
XrdXrootdMonRedir
info
[
sizeof
(
XrdXrootdMonRedir
)];
//This is really [n]
78
};
79
80
struct
XrdXrootdMonMap
81
{
XrdXrootdMonHeader
hdr
;
82
kXR_unt32
dictid
;
83
char
info
[1024+256];
84
};
85
86
const
kXR_char
XROOTD_MON_APPID
= 0xa0;
87
const
kXR_char
XROOTD_MON_CLOSE
= 0xc0;
88
const
kXR_char
XROOTD_MON_DISC
= 0xd0;
89
const
kXR_char
XROOTD_MON_OPEN
= 0x80;
90
const
kXR_char
XROOTD_MON_READV
= 0x90;
91
const
kXR_char
XROOTD_MON_READU
= 0x91;
92
const
kXR_char
XROOTD_MON_REDHOST
= 0xf0;
// No Modifier
93
const
kXR_char
XROOTD_MON_WINDOW
= 0xe0;
94
95
96
const
kXR_char
XROOTD_MON_MAPIDNT
=
'='
;
97
const
kXR_char
XROOTD_MON_MAPPATH
=
'd'
;
98
const
kXR_char
XROOTD_MON_MAPFSTA
=
'f'
;
// The "f" stream
99
const
kXR_char
XROOTD_MON_MAPINFO
=
'i'
;
100
const
kXR_char
XROOTD_MON_MAPMIGR
=
'm'
;
// Internal use only!
101
const
kXR_char
XROOTD_MON_MAPPURG
=
'p'
;
102
const
kXR_char
XROOTD_MON_MAPREDR
=
'r'
;
103
const
kXR_char
XROOTD_MON_MAPSTAG
=
's'
;
// Internal use only!
104
const
kXR_char
XROOTD_MON_MAPTRCE
=
't'
;
105
const
kXR_char
XROOTD_MON_MAPUSER
=
'u'
;
106
const
kXR_char
XROOTD_MON_MAPXFER
=
'x'
;
107
108
// The following bits are insert in the low order 4 bits of the MON_REDIRECT
109
// entry code to indicate the actual operation that was requestded.
110
//
111
const
kXR_char
XROOTD_MON_REDSID
= 0xf0;
// Server Identification
112
const
kXR_char
XROOTD_MON_REDTIME
= 0x00;
// Timing mark
113
114
const
kXR_char
XROOTD_MON_REDIRECT
= 0x80;
// With Modifier below!
115
const
kXR_char
XROOTD_MON_REDLOCAL
= 0x90;
// With Modifier below!
116
117
const
kXR_char
XROOTD_MON_CHMOD
= 0x01;
// Modifiers for the above
118
const
kXR_char
XROOTD_MON_LOCATE
= 0x02;
119
const
kXR_char
XROOTD_MON_OPENDIR
= 0x03;
120
const
kXR_char
XROOTD_MON_OPENC
= 0x04;
121
const
kXR_char
XROOTD_MON_OPENR
= 0x05;
122
const
kXR_char
XROOTD_MON_OPENW
= 0x06;
123
const
kXR_char
XROOTD_MON_MKDIR
= 0x07;
124
const
kXR_char
XROOTD_MON_MV
= 0x08;
125
const
kXR_char
XROOTD_MON_PREP
= 0x09;
126
const
kXR_char
XROOTD_MON_QUERY
= 0x0a;
127
const
kXR_char
XROOTD_MON_RM
= 0x0b;
128
const
kXR_char
XROOTD_MON_RMDIR
= 0x0c;
129
const
kXR_char
XROOTD_MON_STAT
= 0x0d;
130
const
kXR_char
XROOTD_MON_TRUNC
= 0x0e;
131
132
const
kXR_char
XROOTD_MON_FORCED
= 0x01;
133
const
kXR_char
XROOTD_MON_BOUNDP
= 0x02;
134
135
const
int
XROOTD_MON_SRCMASK
= 0x000000f;
136
const
int
XROOTD_MON_TRGMASK
= 0x7fffff0;
137
const
int
XROOTD_MON_NEWSTID
= 0x8000000;
138
139
/******************************************************************************/
140
/* " f " S t r e a m S p e c i f i c R e c o r d s */
141
/******************************************************************************/
142
143
// The UDP buffer layout is as follows:
144
//
145
// XrdXrootdMonHeader with Code == XROOTD_MON_MAPFSTA
146
// XrdXrootdMonFileTOD with recType == isTime
147
// XrdXrootdMonFileHdr with recType == one of recTval (variable length)
148
// ... additional XrdXrootdMonFileHdr's (variable length)
149
// XrdXrootdMonFileTOD with recType == isTime
150
151
struct
XrdXrootdMonFileHdr
// 8
152
{
153
enum
recTval
{
isClose
= 0,
// Record for close
154
isOpen
,
// Record for open
155
isTime
,
// Record for time
156
isXfr
,
// Record for transfers
157
isDisc
// Record for disconnection
158
};
159
160
enum
recFval
{
forced
=0x01,
// If recFlag == isClose close due to disconnect
161
hasOPS
=0x02,
// If recFlag == isClose MonStatXFR + MonStatOPS
162
hasSSQ
=0x04,
// If recFlag == isClose XFR + OPS + MonStatSSQ
163
hasLFN
=0x01,
// If recFlag == isOpen the lfn is present
164
hasRW
=0x02
// If recFlag == isOpen file opened r/w
165
};
166
167
char
recType
;
// RecTval: isClose | isOpen | isTime | isXfr
168
char
recFlag
;
// RecFval: Record type-specific flags
169
short
recSize
;
// Size of this record in bytes
170
union
171
{
172
kXR_unt32
fileID
;
// dictid of file for all rectypes except "disc" & "time"
173
kXR_unt32
userID
;
// dictid of user for rectypes equal "disc"
174
short
nRecs
[2];
// isTime: nRecs[0] == isXfr recs nRecs[1] == total recs
175
};
176
};
177
178
// The following record is always be present as the first record in the udp
179
// udp packet and should be used to establish the recording window.
180
//
181
struct
XrdXrootdMonFileTOD
182
{
183
XrdXrootdMonFileHdr
Hdr
;
// 8
184
int
tBeg
;
// time(0) of following record
185
int
tEnd
;
// time(0) when packet was sent
186
};
187
188
// The following variable length structure exists in XrdXrootdMonFileOPN if
189
// "lfn" has been specified. It exists only when recFlag & hasLFN is TRUE.
190
// The user's dictid will be zero (missing) if user monitoring is not enabled.
191
//
192
struct
XrdXrootdMonFileLFN
193
{
194
kXR_unt32
user
;
// Monitoring dictid for the user, may be 0.
195
char
lfn
[1028];
// Variable length, use recSize!
196
};
197
198
// The following is reported when a file is opened. If "lfn" was specified and
199
// Hdr.recFlag & hasLFN is TRUE the XrdXrootdMonFileLFN structure is present.
200
// However, it variable in size and the next record will be found using recSize.
201
// The lfn is gauranteed to end with at least one null byte.
202
//
203
struct
XrdXrootdMonFileOPN
204
{
205
XrdXrootdMonFileHdr
Hdr
;
// 8
206
long
long
fsz
;
// 8 file size at time of open
207
XrdXrootdMonFileLFN
ufn
;
// Present ONLY if recFlag & hasLFN is TRUE
208
};
209
210
// The following data is collected on a per file basis
211
//
212
struct
XrdXrootdMonStatOPS
// 48 Bytes
213
{
214
int
read
;
// Number of read() calls
215
int
readv
;
// Number of readv() calls
216
int
write
;
// Number of write() calls
217
short
rsMin
;
// Smallest readv() segment count
218
short
rsMax
;
// Largest readv() segment count
219
long
long
rsegs
;
// Number of readv() segments
220
int
rdMin
;
// Smallest read() request size
221
int
rdMax
;
// Largest read() request size
222
int
rvMin
;
// Smallest readv() request size
223
int
rvMax
;
// Largest readv() request size
224
int
wrMin
;
// Smallest write() request size
225
int
wrMax
;
// Largest write() request size
226
};
227
228
union
XrdXrootdMonDouble
229
{
230
long
long
dlong
;
231
double
dreal
;
232
};
233
234
struct
XrdXrootdMonStatSSQ
// 32 Bytes (all values net ordered IEEE754)
235
{
236
XrdXrootdMonDouble
read
;
// Sum (all read requests)**2 (size)
237
XrdXrootdMonDouble
readv
;
// Sum (all readv requests)**2 (size as a unit)
238
XrdXrootdMonDouble
rsegs
;
// Sum (all readv segments)**2 (count as a unit)
239
XrdXrootdMonDouble
write
;
// Sum (all write requests)**2 (size)
240
};
241
242
// The following transfer data is collected for each open file.
243
//
244
struct
XrdXrootdMonStatXFR
245
{
246
long
long
read
;
// Bytes read from file so far using read()
247
long
long
readv
;
// Bytes read from file so far using readv()
248
long
long
write
;
// Bytes written to file so far
249
};
250
251
// The following is reported upon file close. This is a variable length record.
252
// The record always contains XrdXrootdMonStatXFR after XrdXrootdMonFileHdr.
253
// If (recFlag & hasOPS) TRUE XrdXrootdMonStatOPS follows XrdXrootdMonStatXFR
254
// If (recFlag & hasSSQ) TRUE XrdXrootdMonStatSQV follows XrdXrootdMonStatOPS
255
// The XrdXrootdMonStatSSQ information is present only if "ssq" was specified.
256
//
257
struct
XrdXrootdMonFileCLS
// 32 | 80 | 96 Bytes
258
{
259
XrdXrootdMonFileHdr
Hdr
;
// Always present (recSize has full length)
260
XrdXrootdMonStatXFR
Xfr
;
// Always present
261
XrdXrootdMonStatOPS
Ops
;
// Only present when (recFlag & hasOPS) is True
262
XrdXrootdMonStatSSQ
Ssq
;
// Only present when (recFlag & hasSSQ) is True
263
};
264
265
// The following is reported when a user ends a session.
266
//
267
struct
XrdXrootdMonFileDSC
268
{
269
XrdXrootdMonFileHdr
Hdr
;
// 8
270
};
271
272
// The following is reported each interval*count for each open file when "xfr"
273
// is specified. These records may be interspersed with other records.
274
//
275
struct
XrdXrootdMonFileXFR
// 32 Bytes
276
{
277
XrdXrootdMonFileHdr
Hdr
;
// Always present with recType == isXFR
278
XrdXrootdMonStatXFR
Xfr
;
// Always present
279
};
280
#endif
Generated by
1.8.4