Loading...
Searching...
No Matches
XrdXrootdTpcMon Class Reference

`#include <XrdXrootdTpcMon.hh>`

Collaboration diagram for XrdXrootdTpcMon:

## Classes

struct | TpcInfo

## Public Member Functions

| XrdXrootdTpcMon (const char *proto, XrdSysLogger *logP, XrdXrootdGStream &gStrm)
void | Report (TpcInfo &info)

## Detailed Description

Definition at line 40 of file XrdXrootdTpcMon.hh.

## Constructor & Destructor Documentation

## XrdXrootdTpcMon()

XrdXrootdTpcMon::XrdXrootdTpcMon | ( | const char * | proto,
|  | XrdSysLogger * | logP,
|  | XrdXrootdGStream & | gStrm )

Constructor

Parameters

  proto | - the protocol being used for this object.
  logP | - Pointer to the logging object.
  gStrm | - Reference to the gStream to be used for reporting info.

Definition at line 58 of file XrdXrootdTpcMon.cc.

: protocol(proto), gStream(gStrm)
{
const char *colon = ":";
char buff[512];
// Initialize eror object
//
eDest.logger(logP);
// Get our host:port
//
const char *host = getenv("XRDHOST"); if (!host) host = "localhost";
const char *port = getenv("XRDPORT"); if (!port) {colon = ""; port = "";}
snprintf(buff, sizeof(buff), "%s%s%s", host, colon, port);
hostport = strdup(buff);
}
eDest
static XrdSysError eDest(0,"crypto_")
XrdSysError::logger
XrdSysLogger * logger(XrdSysLogger *lp=0)
Definition XrdSysError.hh:141

References eDest.

## Member Function Documentation

## Report()

void XrdXrootdTpcMon::Report | ( | XrdXrootdTpcMon::TpcInfo & | info | ) |

Report a TPC event.

Parameters

  info | - Reference to the filled in TpcInfo object.

Definition at line 124 of file XrdXrootdTpcMon.cc.

{
const char *srcURL, *dstURL;
char bt_buff[40], et_buff[40], sBuff[1024], dBuff[1024], buff[8192];
// Get correct source and destination URLs
//
srcURL = getURL(info.srcURL, protocol, sBuff, sizeof(sBuff));
dstURL = getURL(info.dstURL, protocol, dBuff, sizeof(dBuff));
// Format the line
//
int n = snprintf(buff, sizeof(buff), json_fmt, protocol, info.clID,
getUTC(info.begT, bt_buff, sizeof(bt_buff)),
getUTC(info.endT, et_buff, sizeof(et_buff)),
info.endRC, static_cast<unsigned int>(info.strm),
(info.opts & TpcInfo::isaPush ? "push" : "pull"),
(info.opts & TpcInfo::isIPv4 ? '4' : '6'),
srcURL, dstURL, info.fSize);
// Check for truncation
//
if (n >= (int)sizeof(buff))
eDest.Emsg("TpcMon", protocol, "invalid json; line truncated!");
// Send the message
//
if (!gStream.Insert(buff, n+1))
eDest.Emsg("TpcMon", protocol, "invalid json; gStream buffer rejected!");
}
XrdSysError::Emsg
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
Definition XrdSysError.cc:95
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::dstURL
const char * dstURL
Definition XrdXrootdTpcMon.hh:50
XrdXrootdTpcMon::TpcInfo::strm
unsigned char strm
Definition XrdXrootdTpcMon.hh:54
XrdXrootdTpcMon::TpcInfo::opts
unsigned short opts
Definition XrdXrootdTpcMon.hh:53

References XrdXrootdTpcMon::TpcInfo::begT, XrdXrootdTpcMon::TpcInfo::clID, XrdXrootdTpcMon::TpcInfo::dstURL, eDest, XrdXrootdTpcMon::TpcInfo::endRC, XrdXrootdTpcMon::TpcInfo::endT, XrdXrootdTpcMon::TpcInfo::fSize, XrdXrootdTpcMon::TpcInfo::isaPush, XrdXrootdTpcMon::TpcInfo::isIPv4, XrdXrootdTpcMon::TpcInfo::opts, XrdXrootdTpcMon::TpcInfo::srcURL, and XrdXrootdTpcMon::TpcInfo::strm.

The documentation for this class was generated from the following files:

- XrdXrootdTpcMon.hh
- XrdXrootdTpcMon.cc