Skip to content

Commit

Permalink
XrdApps::JCache: add runtime to time plot
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Joachim Peters committed Jun 10, 2024
1 parent 7717032 commit 6f0fd43
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/XrdApps/XrdClJCachePlugin/file/Art.hh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public:
Art() {}
virtual ~Art() {}

void drawCurve(const std::vector<double>& dataPoints) {
void drawCurve(const std::vector<double>& dataPoints, double runtime) {
if (dataPoints.size() != 10) {
std::cerr << "Error: Exactly 10 data points are required." << std::endl;
return;
Expand Down Expand Up @@ -78,15 +78,15 @@ public:

// Print the X axis
std::cout << std::string(yLegendWidth + 7, ' ') << std::string(plotWidth, '-') << std::endl;
std::cout << std::string(yLegendWidth + 7, ' ') << " 0 1 2 3 4 5 6 7 8 9" << std::endl;
std::cout << std::string(yLegendWidth + 7, ' ') << " 0 1 2 3 4 5 6 7 8 9 [ 10 :=" << std::fixed << std::setprecision(2) << runtime << "s ]"<< std::endl;
}

void drawCurve(const std::vector<long unsigned int>& data, double interval) {
void drawCurve(const std::vector<long unsigned int>& data, double interval, double runtime) {
std::vector<double> newdata;
for ( auto i:data ) {
newdata.push_back(i/1000000.0 / interval);
}
return drawCurve(newdata);
return drawCurve(newdata, runtime);
}
};

2 changes: 1 addition & 1 deletion src/XrdApps/XrdClJCachePlugin/file/XrdClJCacheFile.hh
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ public:
using namespace std::chrono;
std::vector<uint64_t> bins = sStats.bench.GetBins();
Art art;
art.drawCurve(bins, sStats.bench.GetTimePerBin().count() / 1000000.0);
art.drawCurve(bins, sStats.bench.GetTimePerBin().count() / 1000000.0, realTime);
}
}

Expand Down

0 comments on commit 6f0fd43

Please sign in to comment.