Commit 81fabcd4 authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[status] provide access to rejection data

parent fcffe0aa
...@@ -162,6 +162,29 @@ public: ...@@ -162,6 +162,29 @@ public:
{ return curCount + idCountPair.second; }); { return curCount + idCountPair.second; });
} }
/*!
* \brief Get information on rejection events.
*/
auto getRejectionData() const
{
auto result = rejectedCount_;
if (unspecifiedRejectedCount_ > 0)
{
if (result.find("unspecified") != result.end())
{
std::cout << "WARNING:\n"
<< "Rejection reason \"unspecified\" registered, "
<< "as well as rejection events without reason.\n"
<< "These two counters will be added.\n";
result["unlabeled"] += unspecifiedRejectedCount_;
}
else
result["unlabeled"] = unspecifiedRejectedCount_;
}
return result;
}
/*! /*!
* \brief Print current status to terminal. * \brief Print current status to terminal.
*/ */
...@@ -205,6 +228,21 @@ public: ...@@ -205,6 +228,21 @@ public:
<< " | " << std::string( paddingProgess, ' ') << progress << std::endl; << " | " << std::string( paddingProgess, ' ') << progress << std::endl;
} }
/*!
* \brief Print information on rejection events.
*/
void printRejectionData() const
{
std::size_t sumRejected = 0;
const auto data = getRejectionData();
for (const auto& [reason, count] : data)
sumRejected += count;
for (const auto& [reason, count] : data)
std::cout << "\t-" << reason << ": " << count << " / "
<< std::setprecision(2) << std::fixed
<< 100.0*count/sumRejected << " %" << std::endl;
}
private: private:
bool headerPrinted_ = false; bool headerPrinted_ = false;
......
Markdown is supported
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