summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wong <mark@2ndQuadrant.com>2019-06-26 22:20:48 +0000
committerMark Wong <mark@2ndQuadrant.com>2019-06-27 01:26:11 +0000
commit60d31d108e3d2bea1d07d0c18b551dc6d6dd7bf2 (patch)
tree5b1c00c54412c79137c81eda8a6bf39e613f551c
parentaaf9db34d71846ad7b1b8b12c16018dfb820c6f1 (diff)
Remove individual sorting commands
For code simplicity, remove display sorting command exceot for 'o', where you specific the column to sort.
-rw-r--r--commands.c40
-rw-r--r--commands.h4
-rw-r--r--help.h4
-rw-r--r--pg_top.1.in15
4 files changed, 2 insertions, 61 deletions
diff --git a/commands.c b/commands.c
index 9efa549..95e130d 100644
--- a/commands.c
+++ b/commands.c
@@ -68,16 +68,12 @@ struct cmd cmd_map[] = {
{'I', cmd_io},
{'L', cmd_locks},
{'n', cmd_number},
- {'M', cmd_order_mem},
- {'N', cmd_order_pid},
{'o', cmd_order},
- {'P', cmd_order_cpu},
{'q', cmd_quit},
{'R', cmd_replication},
{'Q', cmd_current_query},
{'s', cmd_delay},
{'t', cmd_toggle},
- {'T', cmd_order_time},
{'u', cmd_user},
{'\0', NULL},
};
@@ -405,42 +401,6 @@ cmd_order_mem(struct pg_top_context *pgtctx)
}
int
-cmd_order_pid(struct pg_top_context *pgtctx)
-{
- int i;
-
- if ((i = string_index("pid", pgtctx->statics.order_names)) == -1)
- {
- new_message(MT_standout, " Unrecognized sorting order");
- putchar('\r');
- return Yes;
- }
- else
- {
- pgtctx->order_index = i;
- }
- return No;
-}
-
-int
-cmd_order_time(struct pg_top_context *pgtctx)
-{
- int i;
-
- if ((i = string_index("time", pgtctx->statics.order_names)) == -1)
- {
- new_message(MT_standout, " Unrecognized sorting order");
- putchar('\r');
- return Yes;
- }
- else
- {
- pgtctx->order_index = i;
- }
- return No;
-}
-
-int
cmd_redraw(struct pg_top_context *pgtctx)
{
reset_display(pgtctx);
diff --git a/commands.h b/commands.h
index bc3f151..41aa9c6 100644
--- a/commands.h
+++ b/commands.h
@@ -36,10 +36,6 @@ int cmd_number(struct pg_top_context *);
int cmd_quit(struct pg_top_context *);
int cmd_replication(struct pg_top_context *);
int cmd_order(struct pg_top_context *);
-int cmd_order_cpu(struct pg_top_context *);
-int cmd_order_mem(struct pg_top_context *);
-int cmd_order_pid(struct pg_top_context *);
-int cmd_order_time(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 *);
diff --git a/help.h b/help.h
index 1af0476..bc4a6ac 100644
--- a/help.h
+++ b/help.h
@@ -16,11 +16,7 @@ C - toggle the use of color\n\
E - show execution plan (UPDATE/DELETE safe)\n\
I - show I/O statistics per process (Linux only)\n\
L - show locks held by a process\n\
-M - sort by memory usage\n\
-N - sort by pid\n\
-P - sort by CPU usage\n\
Q - show current query of a process\n\
-T - sort by time\n\
c - toggle the display of process commands\n\
d - change number of displays to show\n\
h or ? - help; show this text\n\
diff --git a/pg_top.1.in b/pg_top.1.in
index a2351d7..2306183 100644
--- a/pg_top.1.in
+++ b/pg_top.1.in
@@ -244,12 +244,6 @@ Toggle the display of idle processes.
Display the currently held locks by a backend process (prompt for process
id.)
.TP
-.B M
-Order by memory utilization.
-.TP
-.B N
-Sort by process id.
-.TP
.B n or #
Change the number of processes to display (prompt for new number).
.TP
@@ -257,10 +251,8 @@ Change the number of processes to display (prompt for new number).
Change the order in which the display is sorted. This command is not
available on all systems. The sort key names when viewing processes vary
fron system to system but usually include: \*(lqcpu\*(rq, \*(lqres\*(rq,
-\*(lqsize\*(rq, \*(lqxtime\*(rq and \*(lqqtime\*(rq. The default is cpu.
-.TP
-.B P
-Sort by processor utilization.
+\*(lqsize\*(rq, \*(lqxtime\*(rq and \*(lqqtime\*(rq. The default is unsorted.
+See the interactive help for available sort key names.
.TP
.B Q
Display the currently running query of a backend process (prompt for process
@@ -274,9 +266,6 @@ Quit
Change the number of seconds to delay between displays
(prompt for new number).
.TP
-.B T
-Order by time.
-.TP
.B u
Display only processes owned by a specific username (prompt for username).
If the username specified is simply \*(lq+\*(rq, then processes belonging