Loading...
Searching...
No Matches
XrdXrootdTpcMon.hh
Go to the documentation of this file.
#ifndef __XRDXROOTDTPCMON_HH__
#define __XRDXROOTDTPCMON_HH__
/******************************************************************************/
/* */
/* X r d X r o o t d T p c M o n . h h */
/* */
/* (c) 2022 by the Board of Trustees of the Leland Stanford, Jr., University */
/* All Rights Reserved */
/* Produced by Andrew Hanushevsky for Stanford University under contract */
/* DE-AC02-76-SFO0515 with the Department of Energy */
/* */
/* This file is part of the XRootD software suite. */
/* */
/* 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 Lesser General Public */
/* License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
/* */
/* The copyright holder's institutional names and contributor's names may not */
/* be used to endorse or promote products derived from this software without */
/* specific prior written permission of the institution or contributor. */
/******************************************************************************/
#include <stddef.h>
#include <time.h>
#include <sys/time.h>
class XrdSysLogger;
class XrdXrootdGStream;
class XrdXrootdTpcMon
{
public:
struct TpcInfo
{
const char* clID; // Client ID
struct timeval begT; // gettimeofday copy started
struct timeval endT; // gettimeofday copy ended
const char* srcURL; // The source URL used
const char* dstURL; // The destination URL used
size_t fSize; // The size of the file
int endRC; // Ending return code (0 means success)
unsigned short opts; // Additional information:
unsigned char strm; // Number of streams used
unsigned char rsvd; // Reserved
static const int isaPush = 0x0001; // opts: Push request otherwise a pull
static const int isIPv4 = 0x0002; // opts: Used IPv4 for xfr else IPv6.
void Init() {clID = "";
begT.tv_sec = 0; begT.tv_usec = 0;
endT.tv_sec = 0; endT.tv_usec = 0;
srcURL = ""; dstURL = "";
fSize = 0; endRC = 0,
opts = 0; strm = 1; rsvd = 0;
}
TpcInfo() {Init();}
~TpcInfo() {}
};
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void Report(TpcInfo &info);
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
XrdXrootdTpcMon(const char *proto, XrdSysLogger* logP,
XrdXrootdGStream& gStrm);
private:
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
~XrdXrootdTpcMon() {}
const char *getURL(const char *spec, const char *prot, char *buff, int bsz);
const char* getUTC(struct timeval& tod, char* utcBuff, int utcBLen);
const char* protocol;
XrdXrootdGStream& gStream;
};
#endif
XrdSysLogger
Definition XrdSysLogger.hh:53
XrdXrootdGStream
Definition XrdXrootdGStream.hh:44
XrdXrootdTpcMon
Definition XrdXrootdTpcMon.hh:41
XrdXrootdTpcMon::Report
void Report(TpcInfo &info)
Definition XrdXrootdTpcMon.cc:124
XrdXrootdTpcMon::XrdXrootdTpcMon
XrdXrootdTpcMon(const char *proto, XrdSysLogger *logP, XrdXrootdGStream &gStrm)
Definition XrdXrootdTpcMon.cc:58
XrdXrootdTpcMon::TpcInfo::rsvd
unsigned char rsvd
Definition XrdXrootdTpcMon.hh:55
XrdXrootdTpcMon::TpcInfo::fSize
size_t fSize
Definition XrdXrootdTpcMon.hh:51
XrdXrootdTpcMon::TpcInfo::clID
const char * clID
Definition XrdXrootdTpcMon.hh:46
XrdXrootdTpcMon::TpcInfo::isIPv4
static const int isIPv4
Definition XrdXrootdTpcMon.hh:58
XrdXrootdTpcMon::TpcInfo::endT
struct timeval endT
Definition XrdXrootdTpcMon.hh:48
XrdXrootdTpcMon::TpcInfo::srcURL
const char * srcURL
Definition XrdXrootdTpcMon.hh:49
XrdXrootdTpcMon::TpcInfo::endRC
int endRC
Definition XrdXrootdTpcMon.hh:52
XrdXrootdTpcMon::TpcInfo::isaPush
static const int isaPush
Definition XrdXrootdTpcMon.hh:57
XrdXrootdTpcMon::TpcInfo::begT
struct timeval begT
Definition XrdXrootdTpcMon.hh:47
XrdXrootdTpcMon::TpcInfo::TpcInfo
TpcInfo()
Definition XrdXrootdTpcMon.hh:68
XrdXrootdTpcMon::TpcInfo::dstURL
const char * dstURL
Definition XrdXrootdTpcMon.hh:50
XrdXrootdTpcMon::TpcInfo::strm
unsigned char strm
Definition XrdXrootdTpcMon.hh:54
XrdXrootdTpcMon::TpcInfo::~TpcInfo
~TpcInfo()
Definition XrdXrootdTpcMon.hh:70
XrdXrootdTpcMon::TpcInfo::Init
void Init()
Definition XrdXrootdTpcMon.hh:60
XrdXrootdTpcMon::TpcInfo::opts
unsigned short opts
Definition XrdXrootdTpcMon.hh:53