xrootd
XrdClMonitor.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // Copyright (c) 2012 by the Board of Trustees of the Leland Stanford, Jr.,
3 // University
4 // Copyright (c) 2012 by European Organization for Nuclear Research (CERN)
5 // Author: Andrew Hanushevsky <abh@stanford.edu>
6 // Author: Lukasz Janyst <ljanyst@cern.ch>
7 //------------------------------------------------------------------------------
8 // XRootD is free software: you can redistribute it and/or modify
9 // it under the terms of the GNU Lesser General Public License as published by
10 // the Free Software Foundation, either version 3 of the License, or
11 // (at your option) any later version.
12 //
13 // XRootD is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public License
19 // along with XRootD. If not, see <http://www.gnu.org/licenses/>.
20 //------------------------------------------------------------------------------
21 
22 //------------------------------------------------------------------------------
39 //------------------------------------------------------------------------------
40 
41 #ifndef __XRD_CL_MONITOR_HH__
42 #define __XRD_CL_MONITOR_HH__
43 
44 #include "XrdCl/XrdClFileSystem.hh"
45 
46 namespace XrdCl
47 {
48  class URL;
49 
50  //----------------------------------------------------------------------------
52  //----------------------------------------------------------------------------
53  class Monitor
54  {
55  public:
56  //------------------------------------------------------------------------
58  //------------------------------------------------------------------------
59  Monitor() {}
60 
61  //------------------------------------------------------------------------
63  //------------------------------------------------------------------------
64  virtual ~Monitor() {}
65 
66  //------------------------------------------------------------------------
68  //------------------------------------------------------------------------
69  struct ConnectInfo
70  {
72  {
73  sTOD.tv_sec = 0; sTOD.tv_usec = 0;
74  eTOD.tv_sec = 0; eTOD.tv_usec = 0;
75  }
76  std::string server;
77  std::string auth;
78  timeval sTOD;
79  timeval eTOD;
80  uint16_t streams;
81  };
82 
83  //------------------------------------------------------------------------
85  //------------------------------------------------------------------------
87  {
89  {}
90  std::string server;
91  uint64_t rBytes;
92  uint64_t sBytes;
93  time_t cTime;
95  };
96 
97  //------------------------------------------------------------------------
99  //------------------------------------------------------------------------
100  struct OpenInfo
101  {
102  OpenInfo(): file(0), fSize(0), oFlags(0) {}
103  const URL *file;
104  std::string dataServer;
105  uint64_t fSize;
106  uint16_t oFlags;
107  };
108 
109  //------------------------------------------------------------------------
111  //------------------------------------------------------------------------
112  struct CloseInfo
113  {
115  file(0), rBytes(0), vBytes(0), wBytes(0), vSegs(0), rCount(0),
116  vCount(0), wCount(0), status(0)
117  {
118  oTOD.tv_sec = 0; oTOD.tv_usec = 0;
119  cTOD.tv_sec = 0; cTOD.tv_usec = 0;
120  }
121  const URL *file;
122  timeval oTOD;
123  timeval cTOD;
124  uint64_t rBytes;
125  uint64_t vBytes;
126  uint64_t wBytes;
127  uint64_t vSegs;
128  uint32_t rCount;
129  uint32_t vCount;
130  uint32_t wCount;
132  };
133 
134  //------------------------------------------------------------------------
136  //------------------------------------------------------------------------
137  struct ErrorInfo
138  {
140  {
141  ErrOpen = 0,
146  };
147 
149  const URL *file;
152  };
153 
154  //------------------------------------------------------------------------
156  //------------------------------------------------------------------------
158  {
160  const URL *origin;
161  const URL *target;
162  };
163 
164  //------------------------------------------------------------------------
168  //------------------------------------------------------------------------
169  struct CopyBInfo
170  {
172  };
173 
174  //------------------------------------------------------------------------
176  //------------------------------------------------------------------------
177  struct CopyEInfo
178  {
180  {
181  bTOD.tv_sec = 0; bTOD.tv_usec = 0;
182  eTOD.tv_sec = 0; eTOD.tv_usec = 0;
183  }
185  int sources;
186  timeval bTOD;
187  timeval eTOD;
189  };
190 
191  //------------------------------------------------------------------------
193  //------------------------------------------------------------------------
195  {
196  CheckSumInfo(): oTime(0), tTime(0), isOK(false) {}
198  std::string cksum;
199  uint64_t oTime;
200  uint64_t tTime;
201  bool isOK;
202  };
203 
204  //------------------------------------------------------------------------
207  //------------------------------------------------------------------------
209  {
218 
219  };
220 
221  //------------------------------------------------------------------------
228  //------------------------------------------------------------------------
229  virtual void Event( EventCode evCode, void *evData ) = 0;
230  };
231 };
232 
233 #endif // __XRD_CL_MONITOR_HH