ext/libuv/test/benchmark-pump.c in libuv-1.2.0 vs ext/libuv/test/benchmark-pump.c in libuv-1.3.0
- old
+ new
@@ -88,25 +88,27 @@
static void show_stats(uv_timer_t* handle) {
int64_t diff;
int i;
#if PRINT_STATS
- LOGF("connections: %d, write: %.1f gbit/s\n",
- write_sockets,
- gbit(nsent, STATS_INTERVAL));
+ fprintf(stderr, "connections: %d, write: %.1f gbit/s\n",
+ write_sockets,
+ gbit(nsent, STATS_INTERVAL));
+ fflush(stderr);
#endif
/* Exit if the show is over */
if (!--stats_left) {
uv_update_time(loop);
diff = uv_now(loop) - start_time;
- LOGF("%s_pump%d_client: %.1f gbit/s\n",
- type == TCP ? "tcp" : "pipe",
- write_sockets,
- gbit(nsent_total, diff));
+ fprintf(stderr, "%s_pump%d_client: %.1f gbit/s\n",
+ type == TCP ? "tcp" : "pipe",
+ write_sockets,
+ gbit(nsent_total, diff));
+ fflush(stderr);
for (i = 0; i < write_sockets; i++) {
if (type == TCP)
uv_close((uv_handle_t*) &tcp_write_handles[i], NULL);
else
@@ -126,14 +128,15 @@
int64_t diff;
uv_update_time(loop);
diff = uv_now(loop) - start_time;
- LOGF("%s_pump%d_server: %.1f gbit/s\n",
- type == TCP ? "tcp" : "pipe",
- max_read_sockets,
- gbit(nrecv_total, diff));
+ fprintf(stderr, "%s_pump%d_server: %.1f gbit/s\n",
+ type == TCP ? "tcp" : "pipe",
+ max_read_sockets,
+ gbit(nrecv_total, diff));
+ fflush(stderr);
}
static void read_sockets_close_cb(uv_handle_t* handle) {
@@ -211,10 +214,13 @@
static void connect_cb(uv_connect_t* req, int status) {
int i;
- if (status) LOG(uv_strerror(status));
+ if (status) {
+ fprintf(stderr, "%s", uv_strerror(status));
+ fflush(stderr);
+ }
ASSERT(status == 0);
write_sockets++;
req_free((uv_req_t*) req);