Commit 5664a0ae authored by Remi Mommsen's avatar Remi Mommsen Committed by Remi Mommsen
Browse files

references #144: report number of active/blacklisted FUs on the hyperdaq page

parent 40d733b5
......@@ -153,7 +153,7 @@ namespace evb {
void writeHLTinfo(const boost::filesystem::path& tmpDir) const;
void writeBlacklist(const boost::filesystem::path& tmpDir) const;
void writeWhitelist(const boost::filesystem::path& tmpDir) const;
void writeHostList(const boost::filesystem::path&, const xdata::String& hosts) const;
uint16_t writeHostList(const boost::filesystem::path&, const xdata::String& hosts) const;
void retrieveFromURL(CURL*, const std::string& url, const boost::filesystem::path& output) const;
void createLockFile(const boost::filesystem::path&) const;
void writeEoLS(const LumiInfoPtr&) const;
......
......@@ -182,6 +182,19 @@ namespace evb {
void requestEvents(const bool val)
{ requestEvents_ = val; }
/**
* Set the number of active (white-listed) FUs
*/
void setActiveFUcount(const uint16_t count)
{ activeFUcount_ = count; }
/**
* Set the number of blacklisted FUs
*/
void setBlacklistedFUcount(const uint16_t count)
{ blacklistedFUcount_ = count; }
private:
using EvBidList = std::list<EvBid>;
......@@ -233,6 +246,8 @@ namespace evb {
uint32_t blockedResources_;
uint16_t currentPriority_;
uint16_t builderId_;
uint32_t activeFUcount_;
uint32_t blacklistedFUcount_;
uint32_t fusHLT_;
uint32_t fusCloud_;
uint32_t fusQuarantined_;
......
......@@ -736,19 +736,23 @@ void evb::bu::DiskWriter::writeHLTinfo(const boost::filesystem::path& tmpDir) co
void evb::bu::DiskWriter::writeBlacklist(const boost::filesystem::path& tmpDir) const
{
const boost::filesystem::path blacklistPath( tmpDir / configuration_->blacklistName.value_ );
writeHostList(blacklistPath, configuration_->fuBlacklist);
const uint16_t count = writeHostList(blacklistPath, configuration_->fuBlacklist);
resourceManager_->setBlacklistedFUcount(count);
}
void evb::bu::DiskWriter::writeWhitelist(const boost::filesystem::path& tmpDir) const
{
const boost::filesystem::path whitelistPath( tmpDir / configuration_->whitelistName.value_ );
writeHostList(whitelistPath, configuration_->fuWhitelist);
const uint16_t count = writeHostList(whitelistPath, configuration_->fuWhitelist);
resourceManager_->setActiveFUcount(count);
}
void evb::bu::DiskWriter::writeHostList(const boost::filesystem::path& path, const xdata::String& hosts) const
uint16_t evb::bu::DiskWriter::writeHostList(const boost::filesystem::path& path, const xdata::String& hosts) const
{
uint16_t count = 0;
std::ofstream hostlist(path.string().c_str());
const std::regex regex("[a-zA-Z0-9]+-[a-zA-Z0-9-]+");
......@@ -762,12 +766,17 @@ void evb::bu::DiskWriter::writeHostList(const boost::filesystem::path& path, con
else
{
hostlist << "[\"" << res->str() << "\"";
while (++res != end) {
count = 1;
while (++res != end)
{
hostlist << ", \"" << res->str() << "\"";
++count;
}
hostlist << "]" << std::endl;
}
hostlist.close();
return count;
}
......
......@@ -33,6 +33,8 @@ evb::bu::ResourceManager::ResourceManager
blockedResources_(1),
currentPriority_(0),
builderId_(0),
activeFUcount_(0),
blacklistedFUcount_(0),
fusHLT_(0),
fusCloud_(0),
fusQuarantined_(0),
......@@ -1239,6 +1241,10 @@ cgicc::div evb::bu::ResourceManager::getHtmlSnipped() const
table table;
table.set("title","If no FU slots are available or the output disk is full, no events are requested unless 'dropEventData' is set to true in the configuration.");
table.add(tr()
.add(td("# available/blacklisted FUs"))
.add(td(std::to_string(activeFUcount_)+"/"+std::to_string(blacklistedFUcount_))));
{
std::lock_guard<std::mutex> guard(lsLatencyMutex_);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment