xrootd
Loading...
Searching...
No Matches
XrdXrootdTpcMon.hh
Go to the documentation of this file.
1#ifndef __XRDXROOTDTPCMON_HH__
2#define __XRDXROOTDTPCMON_HH__
3/******************************************************************************/
4/* */
5/* X r d X r o o t d T p c M o n . h h */
6/* */
7/* (c) 2022 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 <stddef.h>
34#include <time.h>
35#include <sys/time.h>
36
37class XrdSysLogger;
39
41{
42public:
43
44struct TpcInfo
45{
46const char* clID; // Client ID
47struct timeval begT; // gettimeofday copy started
48struct timeval endT; // gettimeofday copy ended
49const char* srcURL; // The source URL used
50const char* dstURL; // The destination URL used
51size_t fSize; // The size of the file
52int endRC; // Ending return code (0 means success)
53unsigned short opts; // Additional information:
54unsigned char strm; // Number of streams used
55unsigned char rsvd; // Reserved
56
57static const int isaPush = 0x0001; // opts: Push request otherwise a pull
58static const int isIPv4 = 0x0002; // opts: Used IPv4 for xfr else IPv6.
59
60void Init() {clID = "";
61 begT.tv_sec = 0; begT.tv_usec = 0;
62 endT.tv_sec = 0; endT.tv_usec = 0;
63 srcURL = ""; dstURL = "";
64 fSize = 0; endRC = 0,
65 opts = 0; strm = 1; rsvd = 0;
66 }
67
69
71};
72
73//-----------------------------------------------------------------------------
77//-----------------------------------------------------------------------------
78
79void Report(TpcInfo &info);
80
81//-----------------------------------------------------------------------------
87//-----------------------------------------------------------------------------
88
89 XrdXrootdTpcMon(const char *proto, XrdSysLogger* logP,
90 XrdXrootdGStream& gStrm);
91
92private:
93
94//-----------------------------------------------------------------------------
96//-----------------------------------------------------------------------------
97
99
100const char *getURL(const char *spec, const char *prot, char *buff, int bsz);
101const char* getUTC(struct timeval& tod, char* utcBuff, int utcBLen);
102
103const char* protocol;
105};
106#endif
Definition XrdSysLogger.hh:53
Definition XrdXrootdGStream.hh:44
Definition XrdXrootdTpcMon.hh:41
~XrdXrootdTpcMon()
Destructor - This object cannot be destroyed.
Definition XrdXrootdTpcMon.hh:98
void Report(TpcInfo &info)
const char * getURL(const char *spec, const char *prot, char *buff, int bsz)
XrdXrootdGStream & gStream
Definition XrdXrootdTpcMon.hh:104
const char * getUTC(struct timeval &tod, char *utcBuff, int utcBLen)
const char * protocol
Definition XrdXrootdTpcMon.hh:103
XrdXrootdTpcMon(const char *proto, XrdSysLogger *logP, XrdXrootdGStream &gStrm)
Definition XrdXrootdTpcMon.hh:45
unsigned char rsvd
Definition XrdXrootdTpcMon.hh:55
size_t fSize
Definition XrdXrootdTpcMon.hh:51
const char * clID
Definition XrdXrootdTpcMon.hh:46
static const int isIPv4
Definition XrdXrootdTpcMon.hh:58
struct timeval endT
Definition XrdXrootdTpcMon.hh:48
const char * srcURL
Definition XrdXrootdTpcMon.hh:49
int endRC
Definition XrdXrootdTpcMon.hh:52
static const int isaPush
Definition XrdXrootdTpcMon.hh:57
struct timeval begT
Definition XrdXrootdTpcMon.hh:47
TpcInfo()
Definition XrdXrootdTpcMon.hh:68
const char * dstURL
Definition XrdXrootdTpcMon.hh:50
unsigned char strm
Definition XrdXrootdTpcMon.hh:54
~TpcInfo()
Definition XrdXrootdTpcMon.hh:70
void Init()
Definition XrdXrootdTpcMon.hh:60
unsigned short opts
Definition XrdXrootdTpcMon.hh:53