diff options
author | Mark Wong <mark@2ndQuadrant.com> | 2020-04-03 22:48:17 +0000 |
---|---|---|
committer | Mark Wong <mark@2ndQuadrant.com> | 2020-04-04 03:01:17 +0000 |
commit | f7c982f31a3464dcc8808caab042fe1af1ee609a (patch) | |
tree | 5cdd493f0dd33b55ddf44b5f73d95c8dbe005e34 | |
parent | 028bf8c41532d17d6a76d1ef0fb4ca8c96812f39 (diff) |
Remove toggle for displaying cumulative vs differential stats
I don't think it make sense to show the raw cumulative numbers from the
operative system, except for debugging. It should be more meaningful
to see the rate of change.
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | commands.c | 21 | ||||
-rw-r--r-- | commands.h | 1 | ||||
-rw-r--r-- | machine.h | 4 | ||||
-rw-r--r-- | machine/m_linux.c | 33 | ||||
-rw-r--r-- | machine/m_remote.c | 35 | ||||
-rw-r--r-- | pg_top.c | 6 |
7 files changed, 21 insertions, 80 deletions
@@ -17,6 +17,7 @@ Release 4.0.0 while removing the 'I' for the top I/O display as a toggle * Show swapping activity * Simplify top I/O display + * Remove toggle for display raw I/O statistics Release 3.7.0 @@ -73,7 +73,6 @@ struct cmd cmd_map[] = { {'R', cmd_replication}, {'Q', cmd_current_query}, {'s', cmd_delay}, - {'t', cmd_toggle}, {'u', cmd_user}, {'\0', NULL}, }; @@ -409,26 +408,6 @@ cmd_redraw(struct pg_top_context *pgtctx) } int -cmd_toggle(struct pg_top_context *pgtctx) -{ - if (mode_stats == STATS_DIFF) - { - mode_stats = STATS_CUMULATIVE; - new_message(MT_standout | MT_delayed, - " Displaying cumulative statistics."); - putchar('\r'); - } - else - { - mode_stats = STATS_DIFF; - new_message(MT_standout | MT_delayed, - " Displaying differential statistics."); - putchar('\r'); - } - return No; -} - -int cmd_update(struct pg_top_context *pgtctx) { /* go home for visual feedback */ @@ -39,7 +39,6 @@ int cmd_replication(struct pg_top_context *); int cmd_order(struct pg_top_context *); int cmd_redraw(struct pg_top_context *); int cmd_statements(struct pg_top_context *); -int cmd_toggle(struct pg_top_context *); int cmd_update(struct pg_top_context *); int cmd_user(struct pg_top_context *); @@ -37,10 +37,6 @@ enum DisplayMode MODE_TYPES /* number of modes */ }; -/* Display modes for table and index statistics. */ -#define STATS_DIFF 0 -#define STATS_CUMULATIVE 1 - /* Maximum number of columns allowed for display */ #define MAX_COLS 255 diff --git a/machine/m_linux.c b/machine/m_linux.c index d553196..09a025f 100644 --- a/machine/m_linux.c +++ b/machine/m_linux.c @@ -957,30 +957,15 @@ format_next_io(caddr_t handle) static char fmt[MAX_COLS]; /* static area where result is built */ struct top_proc *p = &pgtable[proc_index++]; - if (mode_stats == STATS_DIFF) - { - snprintf(fmt, sizeof(fmt), - "%5d %7.0f %7.0f %7.0f %5s %6s %s", - p->pid, - diff_stat(p->iops, p->index) / timediff, - diff_stat(p->syscr, p->index) / timediff, - diff_stat(p->syscw, p->index) / timediff, - format_b(diff_stat(p->read_bytes, p->index) / timediff), - format_b(diff_stat(p->write_bytes, p->index) / timediff), - p->name); - } - else - { - snprintf(fmt, sizeof(fmt), - "%5d %7lld %7lld %7lld %5s %6s %s", - p->pid, - p->iops[p->index], - p->syscr[p->index], - p->syscw[p->index], - format_b(p->read_bytes[p->index]), - format_b(p->write_bytes[p->index]), - p->name); - } + snprintf(fmt, sizeof(fmt), + "%5d %7.0f %7.0f %7.0f %5s %6s %s", + p->pid, + diff_stat(p->iops, p->index) / timediff, + diff_stat(p->syscr, p->index) / timediff, + diff_stat(p->syscw, p->index) / timediff, + format_b(diff_stat(p->read_bytes, p->index) / timediff), + format_b(diff_stat(p->write_bytes, p->index) / timediff), + p->name); return (fmt); } diff --git a/machine/m_remote.c b/machine/m_remote.c index b57de6b..bf56fc4 100644 --- a/machine/m_remote.c +++ b/machine/m_remote.c @@ -685,30 +685,17 @@ format_next_io_r(caddr_t handler) static char fmt[MAX_COLS]; /* static area where result is built */ struct top_proc_r *p = &pgrtable[proc_r_index++]; - if (mode_stats == STATS_DIFF) - snprintf(fmt, sizeof(fmt), - "%5d %5s %5s %7lld %7lld %5s %6s %7s %s", - (int) p->pid, - format_b(p->rchar_diff), - format_b(p->wchar_diff), - p->syscr_diff, - p->syscw_diff, - format_b(p->read_bytes_diff), - format_b(p->write_bytes_diff), - format_b(p->cancelled_write_bytes_diff), - p->name); - else - snprintf(fmt, sizeof(fmt), - "%5d %5s %5s %7lld %7lld %5s %6s %7s %s", - (int) p->pid, - format_b(p->rchar), - format_b(p->wchar), - p->syscr, - p->syscw, - format_b(p->read_bytes), - format_b(p->write_bytes), - format_b(p->cancelled_write_bytes), - p->name); + snprintf(fmt, sizeof(fmt), + "%5d %5s %5s %7lld %7lld %5s %6s %7s %s", + (int) p->pid, + format_b(p->rchar_diff), + format_b(p->wchar_diff), + p->syscr_diff, + p->syscw_diff, + format_b(p->read_bytes_diff), + format_b(p->write_bytes_diff), + format_b(p->cancelled_write_bytes_diff), + p->name); return (fmt); } @@ -128,12 +128,6 @@ void (*d_message) () = i_message; void (*d_process) (int, char *) = i_process; /* - * Mode for display cumulutive or differential stats when displaying table or - * index statistics. - */ -int mode_stats = STATS_DIFF; - -/* * usage - print help message with details about commands */ static void |