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
61585484
Commit
61585484
authored
Dec 10, 2020
by
Dennis Gläser
Browse files
[status] suppress warning if no target was set
parent
bccabdad
Pipeline
#2764
canceled with stages
in 11 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
frackit/sampling/status.hh
View file @
61585484
...
...
@@ -123,8 +123,10 @@ public:
void
increaseCounter
(
const
Id
&
id
)
{
count_
[
id
.
get
()]
++
;
if
(
count_
[
id
.
get
()]
>
targetCount_
[
id
.
get
()])
std
::
cout
<<
"Warning: target count for id "
<<
id
.
get
()
<<
" was surpassed"
<<
std
::
endl
;
if
(
auto
it
=
targetCount_
.
find
(
id
.
get
());
it
!=
targetCount_
.
end
())
if
(
count_
[
id
.
get
()]
>
it
->
second
)
std
::
cout
<<
"Warning: target count for id "
<<
id
.
get
()
<<
" was surpassed"
<<
std
::
endl
;
}
/*!
...
...
@@ -230,12 +232,14 @@ public:
for
(
const
auto
&
pair
:
targetCount_
)
curTargetCount
+=
pair
.
second
;
for
(
const
auto
&
pair
:
rejectedCount_
)
curRejectedCount
+=
pair
.
second
;
const
bool
hasProgess
=
curTargetCount
>
0
;
const
auto
ratio
=
100.0
*
double
(
double
(
curCount
)
/
double
(
curCount
+
curRejectedCount
));
const
auto
progress
=
100.0
*
double
(
curCount
)
/
double
(
curTargetCount
);
const
auto
progress
=
hasProgess
?
100.0
*
double
(
curCount
)
/
double
(
curTargetCount
)
:
0.0
;
std
::
cout
<<
std
::
setprecision
(
2
)
<<
std
::
fixed
;
const
auto
ratioNumChars
=
std
::
to_string
(
int
(
ratio
)).
size
()
+
3
;
const
auto
progressNumChars
=
std
::
to_string
(
int
(
progress
)).
size
()
+
3
;
const
auto
progressNumChars
=
hasProgess
?
std
::
to_string
(
int
(
progress
)).
size
()
+
3
:
std
::
string
(
"n.a."
).
size
()
+
3
;
const
auto
countString
=
std
::
to_string
(
curCount
);
const
auto
rejectedCountString
=
std
::
to_string
(
curRejectedCount
);
...
...
@@ -250,7 +254,7 @@ public:
std
::
cout
<<
" "
<<
std
::
string
(
paddingCount
,
' '
)
<<
countString
+
' '
<<
" | "
<<
std
::
string
(
paddingRejected
,
' '
)
<<
rejectedCountString
+
' '
<<
" | "
<<
std
::
string
(
paddingRatio
,
' '
)
<<
ratio
<<
std
::
string
(
4
,
' '
)
<<
" | "
<<
std
::
string
(
paddingProgess
,
' '
)
<<
progress
<<
std
::
endl
;
<<
" | "
<<
std
::
string
(
paddingProgess
,
' '
)
<<
(
hasProgess
?
std
::
to_string
(
progress
)
:
"n.a."
)
<<
std
::
endl
;
}
/*!
...
...
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