Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
spdlog
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
spdlog
Commits
4b9949de
Commit
4b9949de
authored
Jun 01, 2018
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
format
parent
5997e5aa
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
4 additions
and
11 deletions
+4
-11
bench.cpp
bench/bench.cpp
+2
-6
spdlog-null-async.cpp
bench/spdlog-null-async.cpp
+1
-1
example.cpp
example/example.cpp
+1
-1
mpmc_blocking_q.h
include/spdlog/details/mpmc_blocking_q.h
+0
-1
thread_pool.h
include/spdlog/details/thread_pool.h
+0
-1
test_async.cpp
tests/test_async.cpp
+0
-1
No files found.
bench/bench.cpp
View file @
4b9949de
...
...
@@ -72,18 +72,14 @@ int main(int argc, char *argv[])
cout
<<
"
\n
*******************************************************************************
\n
"
;
cout
<<
"async logging.. "
<<
threads
<<
" threads sharing same logger, "
<<
format
(
howmany
)
<<
" iterations "
<<
endl
;
cout
<<
"*******************************************************************************
\n
"
;
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
spdlog
::
init_thread_pool
(
queue_size
,
1
);
spdlog
::
init_thread_pool
(
queue_size
,
1
);
auto
as
=
spdlog
::
basic_logger_mt
<
spdlog
::
create_async
>
(
"as"
,
"logs/basic_async.log"
,
true
);
bench_mt
(
howmany
,
as
,
threads
);
spdlog
::
drop
(
"as"
);
}
}
catch
(
std
::
exception
&
ex
)
{
...
...
bench/spdlog-null-async.cpp
View file @
4b9949de
...
...
@@ -69,7 +69,7 @@ int main(int argc, char *argv[])
spdlog
::
init_thread_pool
(
tp_queue_size
,
tp_threads
);
auto
as
=
spdlog
::
create_async_logger
<
null_sink_mt
>
(
"async(null-sink)"
);
total_rate
+=
bench_as
(
howmany
,
as
,
client_threads
);
spdlog
::
drop
(
"async(null-sink)"
);
spdlog
::
drop
(
"async(null-sink)"
);
}
std
::
cout
<<
endl
;
std
::
cout
<<
"Avg rate: "
<<
format
(
total_rate
/
iters
)
<<
"/sec"
<<
std
::
endl
;
...
...
example/example.cpp
View file @
4b9949de
...
...
@@ -113,7 +113,7 @@ void async_example()
for
(
int
i
=
0
;
i
<
100
;
++
i
)
{
async_file
->
info
(
"Async message #{}"
,
i
+
1
);
}
}
}
// syslog example (linux/osx/freebsd)
...
...
include/spdlog/details/mpmc_blocking_q.h
View file @
4b9949de
...
...
@@ -71,7 +71,6 @@ public:
pop_cv_
.
notify_one
();
return
true
;
}
private
:
size_t
max_items_
;
...
...
include/spdlog/details/thread_pool.h
View file @
4b9949de
...
...
@@ -138,7 +138,6 @@ public:
{
return
msg_counter_
.
load
(
std
::
memory_order_relaxed
);
}
private
:
std
::
atomic
<
size_t
>
msg_counter_
;
// total # of messages processed in this pool
...
...
tests/test_async.cpp
View file @
4b9949de
...
...
@@ -77,7 +77,6 @@ TEST_CASE("tp->wait_empty() ", "[async]")
logger
->
flush
();
tp
.
reset
();
REQUIRE
(
test_sink
->
msg_counter
()
==
messages
);
REQUIRE
(
test_sink
->
flush_counter
()
==
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