forked from yedf2/handy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
yedongfu
committed
Aug 2, 2014
1 parent
1a3b09e
commit 40ab057
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include "handy.h" | ||
#include "conf.h" | ||
#include "logging.h" | ||
#include "daemon.h" | ||
|
||
using namespace std; | ||
using namespace handy; | ||
|
||
|
||
int main(int argc, const char* argv[]) { | ||
Logger::getLogger().setFileName("/dev/null"); | ||
//Logger::getLogger().setRotateInterval(60); | ||
time_t last = time(NULL); | ||
long cn = 0, lastcn = 0; | ||
for(;;) { | ||
for (int i = 0; i< 1000; i++) { | ||
info("msgid %ld", ++cn); | ||
//info("msg"); cn++; | ||
} | ||
time_t cur = time(NULL); | ||
if (cur != last) { | ||
last = cur; | ||
printf("log qps %ld\n", (cn - lastcn)); | ||
lastcn = cn; | ||
} | ||
} | ||
} |