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
15f914f3
Commit
15f914f3
authored
Dec 03, 2014
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bench queue size
parent
c63e9fae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
bench/spdlog-bench-async.cpp
bench/spdlog-bench-async.cpp
+2
-2
bench/spdlog-bench-mt-async.cpp
bench/spdlog-bench-mt-async.cpp
+1
-2
No files found.
bench/spdlog-bench-async.cpp
View file @
15f914f3
...
@@ -6,13 +6,13 @@ int main(int, char* [])
...
@@ -6,13 +6,13 @@ int main(int, char* [])
{
{
int
howmany
=
1000000
;
int
howmany
=
1000000
;
namespace
spd
=
spdlog
;
namespace
spd
=
spdlog
;
spd
::
set_async_mode
(
2500
,
std
::
chrono
::
seconds
(
0
)
);
spd
::
set_async_mode
(
howmany
);
///Create a file rotating logger with 5mb size max and 3 rotated files
///Create a file rotating logger with 5mb size max and 3 rotated files
auto
logger
=
spd
::
rotating_logger_mt
(
"file_logger"
,
"logs/spd-sample"
,
10
*
1024
*
1024
,
5
);
auto
logger
=
spd
::
rotating_logger_mt
(
"file_logger"
,
"logs/spd-sample"
,
10
*
1024
*
1024
,
5
);
logger
->
set_pattern
(
"[%Y-%b-%d %T.%e]: %v"
);
logger
->
set_pattern
(
"[%Y-%b-%d %T.%e]: %v"
);
for
(
int
i
=
0
;
i
<
howmany
;
++
i
)
for
(
int
i
=
0
;
i
<
howmany
;
++
i
)
logger
->
info
()
<<
"spdlog message #"
<<
i
<<
": This is some text for your pleasure"
;
logger
->
info
()
<<
"spdlog message #"
<<
i
<<
": This is some text for your pleasure"
;
spd
::
stop
();
return
0
;
return
0
;
}
}
bench/spdlog-bench-mt-async.cpp
View file @
15f914f3
...
@@ -17,7 +17,7 @@ int main(int argc, char* argv[])
...
@@ -17,7 +17,7 @@ int main(int argc, char* argv[])
int
howmany
=
1000000
;
int
howmany
=
1000000
;
namespace
spd
=
spdlog
;
namespace
spd
=
spdlog
;
spd
::
set_async_mode
(
2500
,
std
::
chrono
::
seconds
(
0
));
spd
::
set_async_mode
(
howmany
,
std
::
chrono
::
seconds
(
0
));
///Create a file rotating logger with 5mb size max and 3 rotated files
///Create a file rotating logger with 5mb size max and 3 rotated files
auto
logger
=
spd
::
rotating_logger_mt
(
"file_logger"
,
"logs/spd-sample"
,
10
*
1024
*
1024
,
5
);
auto
logger
=
spd
::
rotating_logger_mt
(
"file_logger"
,
"logs/spd-sample"
,
10
*
1024
*
1024
,
5
);
...
@@ -45,6 +45,5 @@ int main(int argc, char* argv[])
...
@@ -45,6 +45,5 @@ int main(int argc, char* argv[])
t
.
join
();
t
.
join
();
};
};
spd
::
stop
();
return
0
;
return
0
;
}
}
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