Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include a list of connections in the HTTP-TPC performance marker. #1157

Merged
merged 2 commits into from
Mar 23, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/XrdTpc/XrdTpcTPC.cc
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ int TPCHandler::SendPerfMarker(XrdHttpExtReq &req, TPC::State &state) {
ss << "Stripe Index: 0" << crlf;
ss << "Stripe Bytes Transferred: " << state.BytesTransferred() << crlf;
ss << "Total Stripe Count: 1" << crlf;
// Include the TCP connection associated with this transfer; used by
// the TPC client for monitoring purposes.
std::string desc = state.GetConnectionDescription();
if (!desc.empty())
ss << "RemoteConnections: " << desc << crlf;
Expand All @@ -257,13 +259,27 @@ int TPCHandler::SendPerfMarker(XrdHttpExtReq &req, TPC::State &state) {
int TPCHandler::SendPerfMarker(XrdHttpExtReq &req, std::vector<State*> &state,
off_t bytes_transferred)
{
// The 'performance marker' format is largely derived from how GridFTP works
// (e.g., the concept of `Stripe` is not quite so relevant here). See:
// https://twiki.cern.ch/twiki/bin/view/LCG/HttpTpcTechnical
// Example marker:
// Perf Marker\n
// Timestamp: 1537788010\n
// Stripe Index: 0\n
// Stripe Bytes Transferred: 238745\n
// Total Stripe Count: 1\n
// RemoteConnections: tcp:129.93.3.4:1234,tcp:[2600:900:6:1301:268a:7ff:fef6:a590]:2345\n
// End\n
//
std::stringstream ss;
const std::string crlf = "\n";
ss << "Perf Marker" << crlf;
ss << "Timestamp: " << time(NULL) << crlf;
ss << "Stripe Index: 0" << crlf;
ss << "Stripe Bytes Transferred: " << bytes_transferred << crlf;
ss << "Total Stripe Count: 1" << crlf;
// Build a list of TCP connections associated with this transfer; used by
// the TPC client for monitoring purposes.
bool first = true;
std::stringstream ss2;
for (std::vector<State*>::const_iterator iter = state.begin();
Expand Down
4 changes: 4 additions & 0 deletions src/XrdTpc/XrdTpcTPC.hh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ private:
int DetermineXferSize(CURL *curl, XrdHttpExtReq &req, TPC::State &state,
bool &success);

// Send a 'performance marker' back to the TPC client, informing it of our
// progress. The TPC client will use this information to determine whether
// the transfer is making sufficient progress and/or other monitoring info
// (such as whether the transfer is happening over IPv4, IPv6, or both).
int SendPerfMarker(XrdHttpExtReq &req, TPC::State &state);
int SendPerfMarker(XrdHttpExtReq &req, std::vector<State*> &state,
off_t bytes_transferred);
Expand Down