diff --git a/documentation/configuration.md b/documentation/configuration.md index a1273a65..3cc9cda7 100644 --- a/documentation/configuration.md +++ b/documentation/configuration.md @@ -515,8 +515,6 @@ database default { #### example (admin console) -Example - ``` storage "local" { type "local" diff --git a/sources/console.c b/sources/console.c index 56243f1b..50977323 100644 --- a/sources/console.c +++ b/sources/console.c @@ -94,7 +94,12 @@ od_console_show_stats_add(shapito_stream_t *stream, return -1; char data[64]; int data_len; - /* total_requests */ + /* total_xact_count */ + data_len = od_snprintf(data, sizeof(data), "%" PRIu64, 0); + rc = shapito_be_write_data_row_add(stream, offset, data, data_len); + if (rc == -1) + return -1; + /* total_query_count */ data_len = od_snprintf(data, sizeof(data), "%" PRIu64, total->count_request); rc = shapito_be_write_data_row_add(stream, offset, data, data_len); if (rc == -1) @@ -107,6 +112,11 @@ od_console_show_stats_add(shapito_stream_t *stream, /* total_sent */ data_len = od_snprintf(data, sizeof(data), "%" PRIu64, total->recv_server); rc = shapito_be_write_data_row_add(stream, offset, data, data_len); + if (rc == -1) + return -1; + /* total_xact_time */ + data_len = od_snprintf(data, sizeof(data), "%" PRIu64, 0); + rc = shapito_be_write_data_row_add(stream, offset, data, data_len); if (rc == -1) return -1; /* total_query_time */ @@ -114,7 +124,17 @@ od_console_show_stats_add(shapito_stream_t *stream, rc = shapito_be_write_data_row_add(stream, offset, data, data_len); if (rc == -1) return -1; - /* avg_req */ + /* total_wait_time */ + data_len = od_snprintf(data, sizeof(data), "%" PRIu64, 0); + rc = shapito_be_write_data_row_add(stream, offset, data, data_len); + if (rc == -1) + return -1; + /* avg_xact_count */ + data_len = od_snprintf(data, sizeof(data), "%" PRIu64, 0); + rc = shapito_be_write_data_row_add(stream, offset, data, data_len); + if (rc == -1) + return -1; + /* avg_query_count */ data_len = od_snprintf(data, sizeof(data), "%" PRIu64, avg->count_request); rc = shapito_be_write_data_row_add(stream, offset, data, data_len); if (rc == -1) @@ -129,9 +149,19 @@ od_console_show_stats_add(shapito_stream_t *stream, rc = shapito_be_write_data_row_add(stream, offset, data, data_len); if (rc == -1) return -1; - /* avg_query */ + /* avg_xact_time */ + data_len = od_snprintf(data, sizeof(data), "%" PRIu64, 0); + rc = shapito_be_write_data_row_add(stream, offset, data, data_len); + if (rc == -1) + return -1; + /* avg_query_time */ data_len = od_snprintf(data, sizeof(data), "%" PRIu64, avg->query_time); rc = shapito_be_write_data_row_add(stream, offset, data, data_len); + if (rc == -1) + return -1; + /* avg_wait_time */ + data_len = od_snprintf(data, sizeof(data), "%" PRIu64, 0); + rc = shapito_be_write_data_row_add(stream, offset, data, data_len); if (rc == -1) return -1; return 0; @@ -155,17 +185,24 @@ od_console_show_stats(od_client_t *client) od_router_t *router = client->global->router; shapito_stream_t *stream = client->stream; shapito_stream_reset(stream); + int rc; - rc = shapito_be_write_row_descriptionf(stream, "sllllllll", + rc = shapito_be_write_row_descriptionf(stream, "sllllllllllllll", "database", - "total_requests", + "total_xact_count", + "total_query_count", "total_received", "total_sent", + "total_xact_time", "total_query_time", - "avg_req", + "total_wait_time", + "avg_xact_count", + "avg_query_count", "avg_recv", "avg_sent", - "avg_query"); + "avg_xact_time", + "avg_query_time", + "avg_wait_time"); if (rc == -1) return -1; rc = od_routepool_stats(&router->route_pool,