Loading...
Searching...
No Matches
XrdClMonitor.hh
Go to the documentation of this file.
//------------------------------------------------------------------------------
// Copyright (c) 2012 by the Board of Trustees of the Leland Stanford, Jr.,
// University
// Copyright (c) 2012 by European Organization for Nuclear Research (CERN)
// Author: Andrew Hanushevsky <abh@stanford.edu>
// Author: Lukasz Janyst <ljanyst@cern.ch>
//------------------------------------------------------------------------------
// XRootD is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// XRootD is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with XRootD. If not, see <http://www.gnu.org/licenses/>.
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#ifndef __XRD_CL_MONITOR_HH__
#define __XRD_CL_MONITOR_HH__
#include "XrdCl/XrdClFileSystem.hh"
#include <sys/time.h>
namespace XrdCl
{
class URL;
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
class Monitor
{
public:
//------------------------------------------------------------------------
//------------------------------------------------------------------------
Monitor() {}
//------------------------------------------------------------------------
//------------------------------------------------------------------------
virtual ~Monitor() {}
//------------------------------------------------------------------------
//------------------------------------------------------------------------
struct ConnectInfo
{
ConnectInfo(): streams( 0 )
{
sTOD.tv_sec = 0; sTOD.tv_usec = 0;
eTOD.tv_sec = 0; eTOD.tv_usec = 0;
}
std::string server;
std::string auth;
timeval sTOD;
timeval eTOD;
uint16_t streams;
};
//------------------------------------------------------------------------
//------------------------------------------------------------------------
struct DisconnectInfo
{
DisconnectInfo(): rBytes(0), sBytes(0), cTime(0)
{}
std::string server;
uint64_t rBytes;
uint64_t sBytes;
time_t cTime;
Status status;
};
//------------------------------------------------------------------------
//------------------------------------------------------------------------
struct OpenInfo
{
OpenInfo(): file(0), fSize(0), oFlags(0) {}
const URL *file;
std::string dataServer;
uint64_t fSize;
uint16_t oFlags;
};
//------------------------------------------------------------------------
//------------------------------------------------------------------------
struct CloseInfo
{
CloseInfo():
file(0), rBytes(0), vrBytes(0), wBytes(0), vwBytes(0), vSegs(0), rCount(0),
vCount(0), wCount(0), status(0)
{
oTOD.tv_sec = 0; oTOD.tv_usec = 0;
cTOD.tv_sec = 0; cTOD.tv_usec = 0;
}
const URL *file;
timeval oTOD;
timeval cTOD;
uint64_t rBytes;
uint64_t vrBytes;
uint64_t wBytes;
uint64_t vwBytes;
uint64_t vSegs;
uint32_t rCount;
uint32_t vCount;
uint32_t wCount;
const XRootDStatus *status;
};
//------------------------------------------------------------------------
//------------------------------------------------------------------------
struct ErrorInfo
{
enum Operation
{
ErrOpen = 0,
ErrRead,
ErrReadV,
ErrWrite,
ErrWriteV,
ErrUnc
};
ErrorInfo(): file(0), status(0), opCode( ErrUnc ) {}
const URL *file;
const XRootDStatus *status;
Operation opCode;
};
//------------------------------------------------------------------------
//------------------------------------------------------------------------
struct TransferInfo
{
TransferInfo(): origin(0), target(0) {}
const URL *origin;
const URL *target;
};
//------------------------------------------------------------------------
//------------------------------------------------------------------------
struct CopyBInfo
{
TransferInfo transfer;
};
//------------------------------------------------------------------------
//------------------------------------------------------------------------
struct CopyEInfo
{
CopyEInfo(): sources(0), status(0)
{
bTOD.tv_sec = 0; bTOD.tv_usec = 0;
eTOD.tv_sec = 0; eTOD.tv_usec = 0;
}
TransferInfo transfer;
int sources;
timeval bTOD;
timeval eTOD;
const XRootDStatus *status;
};
//------------------------------------------------------------------------
//------------------------------------------------------------------------
struct CheckSumInfo
{
CheckSumInfo(): oTime(0), tTime(0), isOK(false) {}
TransferInfo transfer;
std::string cksum;
uint64_t oTime;
uint64_t tTime;
bool isOK;
};
//------------------------------------------------------------------------
//------------------------------------------------------------------------
enum EventCode
{
EvCopyBeg,
EvCopyEnd,
EvCheckSum,
EvOpen,
EvClose,
EvErrIO,
EvConnect,
EvDisconnect
};
//------------------------------------------------------------------------
//------------------------------------------------------------------------
virtual void Event( EventCode evCode, void *evData ) = 0;
};
}
#endif // __XRD_CL_MONITOR_HH
XrdClFileSystem.hh
XrdCl::Monitor::~Monitor
virtual ~Monitor()
Destructor.
Definition XrdClMonitor.hh:66
XrdCl::Monitor::Monitor
Monitor()
Constructor.
Definition XrdClMonitor.hh:61
XrdCl::Monitor::CopyBInfo::transfer
TransferInfo transfer
The transfer in question.
Definition XrdClMonitor.hh:175
XrdCl::Monitor::EventCode
EventCode
Definition XrdClMonitor.hh:213
XrdCl::Monitor::EvCopyBeg
@ EvCopyBeg
CopyBInfo: Copy operation started.
Definition XrdClMonitor.hh:214
XrdCl::Monitor::EvDisconnect
@ EvDisconnect
DisconnectInfo: Logout from a server.
Definition XrdClMonitor.hh:221
XrdCl::Monitor::EvClose
@ EvClose
CloseInfo: File closed.
Definition XrdClMonitor.hh:218
XrdCl::Monitor::EvCopyEnd
@ EvCopyEnd
CopyEInfo: Copy operation ended.
Definition XrdClMonitor.hh:215
XrdCl::Monitor::EvCheckSum
@ EvCheckSum
CheckSumInfo: File checksummed.
Definition XrdClMonitor.hh:216
XrdCl::Monitor::EvErrIO
@ EvErrIO
ErrorInfo: An I/O error occurred.
Definition XrdClMonitor.hh:219
XrdCl::Monitor::EvOpen
@ EvOpen
OpenInfo: File opened.
Definition XrdClMonitor.hh:217
XrdCl::Monitor::EvConnect
@ EvConnect
ConnectInfo: Login into a server.
Definition XrdClMonitor.hh:220
XrdCl::Monitor::Event
virtual void Event(EventCode evCode, void *evData)=0
XrdCl::Monitor::CopyBInfo
Definition XrdClMonitor.hh:174
XrdCl::URL
URL representation.
Definition XrdClURL.hh:31
XrdCl::XRootDStatus
Request status.
Definition XrdClXRootDResponses.hh:219
XrdCl
Definition XrdClAction.hh:34
XrdCl::Monitor::CheckSumInfo::transfer
TransferInfo transfer
The transfer in question.
Definition XrdClMonitor.hh:201
XrdCl::Monitor::CheckSumInfo::tTime
uint64_t tTime
Microseconds to obtain cksum from target.
Definition XrdClMonitor.hh:204
XrdCl::Monitor::CheckSumInfo::isOK
bool isOK
True if checksum matched, false otherwise.
Definition XrdClMonitor.hh:205
XrdCl::Monitor::CheckSumInfo::cksum
std::string cksum
Checksum as "type:value".
Definition XrdClMonitor.hh:202
XrdCl::Monitor::CheckSumInfo::CheckSumInfo
CheckSumInfo()
Definition XrdClMonitor.hh:200
XrdCl::Monitor::CheckSumInfo::oTime
uint64_t oTime
Microseconds to obtain cksum from origin.
Definition XrdClMonitor.hh:203
XrdCl::Monitor::CloseInfo::vwBytes
uint64_t vwBytes
Total number of bytes written vie writev.
Definition XrdClMonitor.hh:129
XrdCl::Monitor::CloseInfo::status
const XRootDStatus * status
Close status.
Definition XrdClMonitor.hh:134
XrdCl::Monitor::CloseInfo::wCount
uint32_t wCount
Total count of writes.
Definition XrdClMonitor.hh:133
XrdCl::Monitor::CloseInfo::CloseInfo
CloseInfo()
Definition XrdClMonitor.hh:116
XrdCl::Monitor::CloseInfo::vSegs
uint64_t vSegs
Total count of readv segments.
Definition XrdClMonitor.hh:130
XrdCl::Monitor::CloseInfo::vrBytes
uint64_t vrBytes
Total number of bytes read via readv.
Definition XrdClMonitor.hh:127
XrdCl::Monitor::CloseInfo::cTOD
timeval cTOD
gettimeofday() when file was closed
Definition XrdClMonitor.hh:125
XrdCl::Monitor::CloseInfo::vCount
uint32_t vCount
Total count of readv.
Definition XrdClMonitor.hh:132
XrdCl::Monitor::CloseInfo::file
const URL * file
The file in question.
Definition XrdClMonitor.hh:123
XrdCl::Monitor::CloseInfo::rBytes
uint64_t rBytes
Total number of bytes read via read.
Definition XrdClMonitor.hh:126
XrdCl::Monitor::CloseInfo::oTOD
timeval oTOD
gettimeofday() when file was opened
Definition XrdClMonitor.hh:124
XrdCl::Monitor::CloseInfo::wBytes
uint64_t wBytes
Total number of bytes written.
Definition XrdClMonitor.hh:128
XrdCl::Monitor::CloseInfo::rCount
uint32_t rCount
Total count of reads.
Definition XrdClMonitor.hh:131
XrdCl::Monitor::ConnectInfo::server
std::string server
"user@host:port"
Definition XrdClMonitor.hh:78
XrdCl::Monitor::ConnectInfo::streams
uint16_t streams
Number of streams.
Definition XrdClMonitor.hh:82
XrdCl::Monitor::ConnectInfo::ConnectInfo
ConnectInfo()
Definition XrdClMonitor.hh:73
XrdCl::Monitor::ConnectInfo::sTOD
timeval sTOD
gettimeofday() when login started
Definition XrdClMonitor.hh:80
XrdCl::Monitor::ConnectInfo::eTOD
timeval eTOD
gettimeofday() when login ended
Definition XrdClMonitor.hh:81
XrdCl::Monitor::ConnectInfo::auth
std::string auth
authentication protocol used or empty if none
Definition XrdClMonitor.hh:79
XrdCl::Monitor::CopyEInfo::CopyEInfo
CopyEInfo()
Definition XrdClMonitor.hh:183
XrdCl::Monitor::CopyEInfo::transfer
TransferInfo transfer
The transfer in question.
Definition XrdClMonitor.hh:188
XrdCl::Monitor::CopyEInfo::sources
int sources
Number of sources used for the copy.
Definition XrdClMonitor.hh:189
XrdCl::Monitor::CopyEInfo::bTOD
timeval bTOD
Copy start time.
Definition XrdClMonitor.hh:190
XrdCl::Monitor::CopyEInfo::status
const XRootDStatus * status
Status of the copy.
Definition XrdClMonitor.hh:192
XrdCl::Monitor::CopyEInfo::eTOD
timeval eTOD
Copy end time.
Definition XrdClMonitor.hh:191
XrdCl::Monitor::DisconnectInfo::rBytes
uint64_t rBytes
Number of bytes received.
Definition XrdClMonitor.hh:93
XrdCl::Monitor::DisconnectInfo::status
Status status
Disconnection status.
Definition XrdClMonitor.hh:96
XrdCl::Monitor::DisconnectInfo::server
std::string server
"user@host:port"
Definition XrdClMonitor.hh:92
XrdCl::Monitor::DisconnectInfo::cTime
time_t cTime
Seconds connected to the server.
Definition XrdClMonitor.hh:95
XrdCl::Monitor::DisconnectInfo::DisconnectInfo
DisconnectInfo()
Definition XrdClMonitor.hh:90
XrdCl::Monitor::DisconnectInfo::sBytes
uint64_t sBytes
Number of bytes sent.
Definition XrdClMonitor.hh:94
XrdCl::Monitor::ErrorInfo::Operation
Operation
Definition XrdClMonitor.hh:143
XrdCl::Monitor::ErrorInfo::ErrWrite
@ ErrWrite
Write.
Definition XrdClMonitor.hh:147
XrdCl::Monitor::ErrorInfo::ErrReadV
@ ErrReadV
Readv.
Definition XrdClMonitor.hh:146
XrdCl::Monitor::ErrorInfo::ErrUnc
@ ErrUnc
Unclassified operation.
Definition XrdClMonitor.hh:149
XrdCl::Monitor::ErrorInfo::ErrOpen
@ ErrOpen
Open (ditto).
Definition XrdClMonitor.hh:144
XrdCl::Monitor::ErrorInfo::ErrRead
@ ErrRead
Read.
Definition XrdClMonitor.hh:145
XrdCl::Monitor::ErrorInfo::ErrWriteV
@ ErrWriteV
WriteV.
Definition XrdClMonitor.hh:148
XrdCl::Monitor::ErrorInfo::status
const XRootDStatus * status
Status code.
Definition XrdClMonitor.hh:154
XrdCl::Monitor::ErrorInfo::file
const URL * file
The file in question.
Definition XrdClMonitor.hh:153
XrdCl::Monitor::ErrorInfo::opCode
Operation opCode
The associated operation.
Definition XrdClMonitor.hh:155
XrdCl::Monitor::ErrorInfo::ErrorInfo
ErrorInfo()
Definition XrdClMonitor.hh:152
XrdCl::Monitor::OpenInfo::fSize
uint64_t fSize
File size in bytes.
Definition XrdClMonitor.hh:107
XrdCl::Monitor::OpenInfo::file
const URL * file
File in question.
Definition XrdClMonitor.hh:105
XrdCl::Monitor::OpenInfo::dataServer
std::string dataServer
Actual fata server.
Definition XrdClMonitor.hh:106
XrdCl::Monitor::OpenInfo::oFlags
uint16_t oFlags
OpenFlags.
Definition XrdClMonitor.hh:108
XrdCl::Monitor::OpenInfo::OpenInfo
OpenInfo()
Definition XrdClMonitor.hh:104
XrdCl::Monitor::TransferInfo
Describe the transfer.
Definition XrdClMonitor.hh:162
XrdCl::Monitor::TransferInfo::target
const URL * target
URL of the target.
Definition XrdClMonitor.hh:165
XrdCl::Monitor::TransferInfo::TransferInfo
TransferInfo()
Definition XrdClMonitor.hh:163
XrdCl::Monitor::TransferInfo::origin
const URL * origin
URL of the origin.
Definition XrdClMonitor.hh:164
XrdCl::Status
Procedure execution status.
Definition XrdClStatus.hh:115