Revert "print the per-user RX and TX bytes from occtl"

This reverts commit ecd6e316a9.
This commit is contained in:
Nikos Mavrogiannopoulos
2014-09-03 19:15:08 +02:00
parent be50fb3ac1
commit c79eefcf9c
4 changed files with 15 additions and 36 deletions

View File

@@ -39,8 +39,6 @@ message user_info_rep
repeated string nbns = 19; repeated string nbns = 19;
repeated string routes = 20; repeated string routes = 20;
repeated string iroutes = 21; repeated string iroutes = 21;
optional uint64 rx_bytes = 22;
optional uint64 tx_bytes = 23;
} }
message user_list_rep message user_list_rep

View File

@@ -329,8 +329,6 @@ static int append_user_info(method_ctx *ctx,
rep->tls_ciphersuite = ctmp->tls_ciphersuite; rep->tls_ciphersuite = ctmp->tls_ciphersuite;
rep->dtls_ciphersuite = ctmp->dtls_ciphersuite; rep->dtls_ciphersuite = ctmp->dtls_ciphersuite;
rep->rx_bytes = ctmp->bytes_in;
rep->tx_bytes = ctmp->bytes_out;
if (single > 0) { if (single > 0) {
if (ctmp->config.rx_per_sec > 0) if (ctmp->config.rx_per_sec > 0)

View File

@@ -560,7 +560,6 @@ int common_info_cmd(UserListRep * args)
unsigned at_least_one = 0; unsigned at_least_one = 0;
int ret = 1, r; int ret = 1, r;
unsigned i; unsigned i;
char buf[32];
out = pager_start(); out = pager_start();
@@ -606,6 +605,7 @@ int common_info_cmd(UserListRep * args)
if (args->user[i]->rx_per_sec > 0 || args->user[i]->tx_per_sec > 0) { if (args->user[i]->rx_per_sec > 0 || args->user[i]->tx_per_sec > 0) {
/* print limits */ /* print limits */
char buf[32];
if (args->user[i]->rx_per_sec > 0 && args->user[i]->tx_per_sec > 0) { if (args->user[i]->rx_per_sec > 0 && args->user[i]->tx_per_sec > 0) {
bytes2human(args->user[i]->rx_per_sec, buf, sizeof(buf), NULL); bytes2human(args->user[i]->rx_per_sec, buf, sizeof(buf), NULL);
@@ -624,12 +624,6 @@ int common_info_cmd(UserListRep * args)
print_iface_stats(args->user[i]->tun, args->user[i]->conn_time, out); print_iface_stats(args->user[i]->tun, args->user[i]->conn_time, out);
bytes2human(args->user[i]->rx_bytes, buf, sizeof(buf), NULL);
fprintf(out, "\tRX data: %s ", buf);
bytes2human(args->user[i]->tx_bytes, buf, sizeof(buf), NULL);
fprintf(out, "\tTX data: %s\n", buf);
if (args->user[i]->hostname != NULL && args->user[i]->hostname[0] != 0) if (args->user[i]->hostname != NULL && args->user[i]->hostname[0] != 0)
fprintf(out, "\tHostname: %s\n", args->user[i]->hostname); fprintf(out, "\tHostname: %s\n", args->user[i]->hostname);

View File

@@ -630,31 +630,25 @@ static void http_req_deinit(worker_st * ws)
ws->req.body = NULL; ws->req.body = NULL;
} }
static int send_stats_msg(worker_st * ws)
{
CliStatsMsg msg = CLI_STATS_MSG__INIT;
int ret;
msg.bytes_in = ws->tun_bytes_in;
msg.bytes_out = ws->tun_bytes_out;
ret = send_msg_to_main(ws, CMD_CLI_STATS, &msg,
(pack_size_func)
cli_stats_msg__get_packed_size,
(pack_func) cli_stats_msg__pack);
oclog(ws, LOG_DEBUG,
"sending stats (in: %lu, out: %lu) to main",
(unsigned long)msg.bytes_in,
(unsigned long)msg.bytes_out);
return ret;
}
static static
void exit_worker(worker_st * ws) void exit_worker(worker_st * ws)
{ {
/* send statistics to parent */ /* send statistics to parent */
if (ws->auth_state == S_AUTH_COMPLETE) { if (ws->auth_state == S_AUTH_COMPLETE) {
send_stats_msg(ws); CliStatsMsg msg = CLI_STATS_MSG__INIT;
msg.bytes_in = ws->tun_bytes_in;
msg.bytes_out = ws->tun_bytes_out;
send_msg_to_main(ws, CMD_CLI_STATS, &msg,
(pack_size_func)
cli_stats_msg__get_packed_size,
(pack_func) cli_stats_msg__pack);
oclog(ws, LOG_DEBUG,
"sending stats (in: %lu, out: %lu) to main",
(unsigned long)msg.bytes_in,
(unsigned long)msg.bytes_out);
} }
talloc_free(ws->main_pool); talloc_free(ws->main_pool);
closelog(); closelog();
@@ -1033,11 +1027,6 @@ int periodic_check(worker_st * ws, unsigned mtu_overhead, time_t now,
} }
} }
ret = send_stats_msg(ws);
if (ret < 0) {
oclog(ws, LOG_INFO, "error in sending stats");
}
cleanup: cleanup:
ws->last_periodic_check = now; ws->last_periodic_check = now;