Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
HEPnOS
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sds
HEP
HEPnOS
Commits
f07057f1
Commit
f07057f1
authored
Apr 14, 2020
by
Matthieu Dorier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added methods to print statistics
parent
9882df6e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
13 deletions
+29
-13
include/hepnos/Statistics.hpp
include/hepnos/Statistics.hpp
+13
-0
include/hepnos/WriteBatch.hpp
include/hepnos/WriteBatch.hpp
+3
-0
src/AsyncEngineImpl.hpp
src/AsyncEngineImpl.hpp
+5
-13
src/WriteBatch.cpp
src/WriteBatch.cpp
+8
-0
No files found.
include/hepnos/Statistics.hpp
View file @
f07057f1
...
...
@@ -6,6 +6,8 @@
#ifndef __HEPNOS_STATISTICS_H
#define __HEPNOS_STATISTICS_H
#include <ostream>
namespace
hepnos
{
/**
...
...
@@ -41,4 +43,15 @@ struct Statistics {
}
template
<
typename
Number
,
typename
Double
=
double
>
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
hepnos
::
Statistics
<
Number
,
Double
>&
stats
)
{
return
os
<<
"{
\"
num
\"
: "
<<
stats
.
num
<<
",
\"
max
\"
: "
<<
stats
.
max
<<
",
\"
min
\"
: "
<<
stats
.
min
<<
",
\"
avg
\"
: "
<<
stats
.
avg
<<
",
\"
var
\"
: "
<<
stats
.
var
<<
" }"
;
}
#endif
include/hepnos/WriteBatch.hpp
View file @
f07057f1
...
...
@@ -6,6 +6,7 @@
#ifndef __HEPNOS_WRITE_BATCH_H
#define __HEPNOS_WRITE_BATCH_H
#include <ostream>
#include <memory>
#include <string>
#include <vector>
...
...
@@ -130,4 +131,6 @@ class WriteBatch {
}
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
hepnos
::
WriteBatchStatistics
&
stats
);
#endif
src/AsyncEngineImpl.hpp
View file @
f07057f1
...
...
@@ -38,9 +38,6 @@ class AsyncEngineImpl {
for
(
size_t
i
=
0
;
i
<
num_threads
;
i
++
)
{
m_xstreams
.
push_back
(
tl
::
xstream
::
create
(
tl
::
scheduler
::
predef
::
deflt
,
m_pool
));
}
for
(
auto
&
es
:
m_xstreams
)
{
es
->
start
();
}
}
else
{
auto
current_es
=
tl
::
xstream
::
self
();
auto
pools
=
current_es
.
get_main_pools
(
1
);
...
...
@@ -125,19 +122,14 @@ class AsyncEngineImpl {
}
void
wait
()
{
// join the
current
set of ES
// join the set of ES
for
(
auto
&
es
:
m_xstreams
)
{
es
->
join
();
}
// create a new set of ES
std
::
vector
<
tl
::
managed
<
tl
::
xstream
>>
new_es
;
for
(
unsigned
i
=
0
;
i
<
m_xstreams
.
size
();
i
++
)
{
new_es
.
push_back
(
tl
::
xstream
::
create
(
tl
::
scheduler
::
predef
::
deflt
,
m_pool
));
}
// replace old es
m_xstreams
=
std
::
move
(
new_es
);
// starting new ES
for
(
auto
&
es
:
m_xstreams
)
es
->
start
();
// revive the ES
for
(
auto
&
es
:
m_xstreams
)
{
es
->
revive
();
}
}
};
...
...
src/WriteBatch.cpp
View file @
f07057f1
...
...
@@ -50,3 +50,11 @@ void WriteBatch::collectStatistics(WriteBatchStatistics& stats) const {
}
}
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
hepnos
::
WriteBatchStatistics
&
stats
)
{
return
os
<<
"{
\"
batch_size
\"
: "
<<
stats
.
batch_sizes
<<
",
\"
key_sizes
\"
: "
<<
stats
.
key_sizes
<<
",
\"
value_size
\"
: "
<<
stats
.
value_sizes
<<
" }"
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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