xrootd
Main Page
Namespaces
Classes
Files
File List
File Members
src
XrdMon
XrdMonSndDummyXrootd.hh
Go to the documentation of this file.
1
/*****************************************************************************/
2
/* */
3
/* XrdMonSndDummyXrootd.hh */
4
/* */
5
/* (c) 2005 by the Board of Trustees of the Leland Stanford, Jr., University */
6
/* All Rights Reserved */
7
/* Produced by Jacek Becla for Stanford University under contract */
8
/* DE-AC02-76SF00515 with the Department of Energy */
9
/*****************************************************************************/
10
11
// $Id$
12
13
#ifndef XRDMONSNDDUMMYXROOTD_HH
14
#define XRDMONSNDDUMMYXROOTD_HH
15
16
#include <vector>
17
#include <string>
18
#include "
XrdMon/XrdMonTypes.hh
"
19
#include "
XrdMon/XrdMonSndTraceEntry.hh
"
20
#include "
XrdMon/XrdMonSndDictEntry.hh
"
21
#include "
XrdMon/XrdMonSndStageEntry.hh
"
22
using
std::vector;
23
using
std::string;
24
25
class
XrdMonSndDummyXrootd
{
26
public
:
27
static
kXR_int16
NEWUSERFREQUENCY
;
28
static
kXR_int16
NEWPROCFREQUENCY
;
29
static
kXR_int16
NEWFILEFREQUENCY
;
30
static
kXR_int16
MAXHOSTS
;
31
32
XrdMonSndDummyXrootd
();
33
~XrdMonSndDummyXrootd
();
34
35
int
initialize
(
const
char
* pathFile);
36
XrdMonSndDictEntry
newXrdMonSndDictEntry
();
37
XrdMonSndStageEntry
newXrdMonSndStageEntry
();
38
XrdMonSndTraceEntry
newXrdMonSndTraceEntry
();
39
kXR_int32
closeOneFile
();
40
void
closeFiles
(vector<kXR_int32>& closedFiles);
41
42
private
:
43
int
readPaths
(
const
char
* pathFile);
44
void
createUser
();
45
void
createProcess
();
46
void
createFile
();
47
string
generateUserName
(
kXR_int16
uid);
48
string
generateHostName
();
49
50
struct
User
{
51
struct
HostAndPid
{
52
string
name
;
53
kXR_int16
pid
;
54
vector<kXR_int16>
myFiles
;
// offsets in _paths vector
55
HostAndPid
(
string
n,
kXR_int16
id
)
56
:
name
(n),
pid
(id) {};
57
};
58
59
kXR_int16
uid
;
60
vector<HostAndPid>
myProcesses
;
61
User
(
kXR_int16
id
) :
uid
(id) {}
62
};
63
64
vector<User>
_users
;
65
66
kXR_int32
_noCalls2NewUser
;
67
kXR_int32
_noCalls2NewProc
;
68
kXR_int32
_noCalls2NewFile
;
69
70
kXR_int16
_activeUser
;
71
kXR_int16
_activeProcess
;
72
kXR_int16
_activeFile
;
73
bool
_newFile
;
74
75
struct
PathData
{
76
string
path
;
77
kXR_int16
fd
;
78
PathData
(
const
char
* s,
kXR_int16
id
) :
path
(s),
fd
(id) {}
79
};
80
81
// input data to pick from, loaded from ascii file
82
// Yes, this might be a lot of memory
83
vector<PathData>
_paths
;
84
85
kXR_int32
_firstAvailId
;
86
vector<kXR_unt32>
_noTracesPerDict
;
87
88
vector<bool>
_openFiles
;
// true: open, false: close
89
};
90
91
#endif
/* XRDMONSNDDUMMYXROOTD_HH */
Generated by
1.8.3.1