Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tools
frackit
Commits
1a23148e
Commit
1a23148e
authored
Nov 29, 2020
by
Dennis Gläser
Browse files
[status] provide access to reason-specific rejections
parent
5a954bcb
Changes
1
Hide whitespace changes
Inline
Side-by-side
frackit/sampling/status.hh
View file @
1a23148e
...
...
@@ -165,10 +165,32 @@ public:
{
return
curCount
+
idCountPair
.
second
;
});
}
/*!
* \brief Returns the rejected entity count.
*/
std
::
size_t
getRejectedCount
()
const
{
const
auto
data
=
getRejectionData
();
return
std
::
accumulate
(
data
.
begin
(),
data
.
end
(),
0
,
[]
(
const
auto
&
curCount
,
const
auto
&
reasonCountPair
)
{
return
curCount
+
reasonCountPair
.
second
;
});
}
/*!
* \brief Returns the rejected entity count for a specific reason.
*/
std
::
size_t
getRejectedCount
(
const
std
::
string
&
reason
)
const
{
auto
it
=
rejectedCount_
.
find
(
reason
);
return
it
!=
rejectedCount_
.
end
()
?
it
->
second
:
0
;
}
/*!
* \brief Get information on rejection events.
*/
auto
getRejectionData
()
const
std
::
unordered_map
<
std
::
string
,
std
::
size_t
>
getRejectionData
()
const
{
auto
result
=
rejectedCount_
;
if
(
unspecifiedRejectedCount_
>
0
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment