bench and examples updates

This commit is contained in:
gabime
2014-12-07 05:48:32 +02:00
parent 5897584175
commit 76436d07cc
5 changed files with 13 additions and 346 deletions

View File

@@ -4,7 +4,7 @@
int main(int, char* [])
{
int howmany = 1000000;
int howmany = 1048576;
namespace spd = spdlog;
spd::set_async_mode(howmany);
///Create a file rotating logger with 5mb size max and 3 rotated files
@@ -14,5 +14,9 @@ int main(int, char* [])
for(int i = 0 ; i < howmany; ++i)
logger->info() << "spdlog message #" << i << ": This is some text for your pleasure";
//because spdlog async logger waits for the back thread logger to finish all messages upon destrcuting,
//and we want to measure only the time it took to push those messages to the backthread..
abort();
return 0;
}

View File

@@ -14,10 +14,10 @@ int main(int argc, char* argv[])
if(argc > 1)
thread_count = atoi(argv[1]);
int howmany = 1000000;
int howmany = 1048576;
namespace spd = spdlog;
spd::set_async_mode(howmany, std::chrono::seconds(0));
spd::set_async_mode(howmany);
///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);
@@ -45,5 +45,7 @@ int main(int argc, char* argv[])
t.join();
};
return 0;
//because spdlog async logger waits for the back thread logger to finish all messages upon destrcuting,
//and we want to measure only the time it took to push those messages to the backthread..
abort();
}