Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
spdlog
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
Libraries
spdlog
Commits
25d3c83d
Commit
25d3c83d
authored
Aug 26, 2019
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update async bench
parent
6b7f3db2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
bench/async_bench.cpp
bench/async_bench.cpp
+2
-4
No files found.
bench/async_bench.cpp
View file @
25d3c83d
...
...
@@ -48,6 +48,7 @@ int count_lines(const char *filename)
void
verify_file
(
const
char
*
filename
,
int
expected_count
)
{
spdlog
::
info
(
"Verifying {} to contain {:n} line.."
,
filename
,
expected_count
);
auto
count
=
count_lines
(
filename
);
if
(
count
!=
expected_count
)
{
...
...
@@ -115,11 +116,7 @@ int main(int argc, char *argv[])
auto
file_sink
=
std
::
make_shared
<
spdlog
::
sinks
::
basic_file_sink_mt
>
(
filename
,
true
);
auto
logger
=
std
::
make_shared
<
async_logger
>
(
"async_logger"
,
std
::
move
(
file_sink
),
std
::
move
(
tp
),
async_overflow_policy
::
block
);
bench_mt
(
howmany
,
std
::
move
(
logger
),
threads
);
verify_file
(
filename
,
howmany
);
#ifdef SPDLOG_ASYNC_BENCH_VERIFY
verify_file
(
filename
,
howmany
);
#endif // SPDLOG_ASYNC_BENCH_VERIFY
}
spdlog
::
info
(
""
);
...
...
@@ -127,6 +124,7 @@ int main(int argc, char *argv[])
spdlog
::
info
(
"Queue Overflow Policy: overrun"
);
spdlog
::
info
(
"*********************************"
);
// do same test but discard oldest if queue is full instead of blocking
filename
=
"logs/basic_async-overrun.log"
;
for
(
int
i
=
0
;
i
<
iters
;
i
++
)
{
auto
tp
=
std
::
make_shared
<
details
::
thread_pool
>
(
queue_size
,
1
);
...
...
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