Commit 7dc6f6e2 by Dwight Engen Committed by Stéphane Graber

port lxc-top from lua to C for wider availability

- keep but rename the lua version as an example of how to use the lua API - got rid of the fairly useless --max argument Signed-off-by: 's avatarDwight Engen <dwight.engen@oracle.com> Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
parent 3cd988cc
...@@ -47,7 +47,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ...@@ -47,7 +47,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
<cmdsynopsis> <cmdsynopsis>
<command>lxc-top</command> <command>lxc-top</command>
<arg choice="opt">--help</arg> <arg choice="opt">--help</arg>
<arg choice="opt">--max <replaceable>count</replaceable></arg>
<arg choice="opt">--delay <replaceable>delay</replaceable></arg> <arg choice="opt">--delay <replaceable>delay</replaceable></arg>
<arg choice="opt">--sort <replaceable>sortby</replaceable></arg> <arg choice="opt">--sort <replaceable>sortby</replaceable></arg>
<arg choice="opt">--reverse</arg> <arg choice="opt">--reverse</arg>
...@@ -60,9 +59,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ...@@ -60,9 +59,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
<command>lxc-top</command> displays container statistics. The output <command>lxc-top</command> displays container statistics. The output
is updated every <replaceable>delay</replaceable> seconds, and is is updated every <replaceable>delay</replaceable> seconds, and is
ordered according to the <replaceable>sortby</replaceable> value ordered according to the <replaceable>sortby</replaceable> value
given. Specifying <replaceable>count</replaceable> will limit the given. <command>lxc-top</command> will display as many containers as
number of containers displayed, otherwise <command>lxc-top</command> can fit in your terminal. Press 'q' to quit. Press one of the sort
will display as many containers as can fit in your terminal. key letters to sort by that statistic. Pressing a sort key letter a
second time reverses the sort order.
</para> </para>
</refsect1> </refsect1>
...@@ -72,26 +72,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ...@@ -72,26 +72,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
<varlistentry> <varlistentry>
<term> <term>
<option><optional>-m, --max <replaceable>count</replaceable></optional></option>
</term>
<listitem>
<para>
Limit the number of containers displayed to
<replaceable>count</replaceable>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option><optional>-d, --delay <replaceable>delay</replaceable></optional></option> <option><optional>-d, --delay <replaceable>delay</replaceable></optional></option>
</term> </term>
<listitem> <listitem>
<para> <para>
Amount of time in seconds to delay between screen updates. Amount of time in seconds to delay between screen updates.
This can be specified as less than a second by giving a The default is 3 seconds.
rational number, for example 0.5 for a half second delay. The
default is 3 seconds.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -103,7 +89,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ...@@ -103,7 +89,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
<para> <para>
Sort the containers by name, cpu use, or memory use. The Sort the containers by name, cpu use, or memory use. The
<replaceable>sortby</replaceable> argument should be one of <replaceable>sortby</replaceable> argument should be one of
the letters n,c,d,m,k to sort by name, cpu use, disk I/O, memory, the letters n,c,b,m,k to sort by name, cpu use, block I/O, memory,
or kernel memory use respectively. The default is 'n'. or kernel memory use respectively. The default is 'n'.
</para> </para>
</listitem> </listitem>
......
...@@ -165,7 +165,7 @@ bin_SCRIPTS = lxc-checkconfig ...@@ -165,7 +165,7 @@ bin_SCRIPTS = lxc-checkconfig
EXTRA_DIST = \ EXTRA_DIST = \
lxc-device \ lxc-device \
lxc-ls \ lxc-ls \
lxc-top \ lxc-top.lua \
lxc.net \ lxc.net \
lxc-restore-net lxc-restore-net
...@@ -177,10 +177,6 @@ else ...@@ -177,10 +177,6 @@ else
bin_SCRIPTS += legacy/lxc-ls bin_SCRIPTS += legacy/lxc-ls
endif endif
if ENABLE_LUA
bin_SCRIPTS += lxc-top
endif
bin_PROGRAMS = \ bin_PROGRAMS = \
lxc-attach \ lxc-attach \
lxc-autostart \ lxc-autostart \
...@@ -198,6 +194,7 @@ bin_PROGRAMS = \ ...@@ -198,6 +194,7 @@ bin_PROGRAMS = \
lxc-snapshot \ lxc-snapshot \
lxc-start \ lxc-start \
lxc-stop \ lxc-stop \
lxc-top \
lxc-unfreeze \ lxc-unfreeze \
lxc-unshare \ lxc-unshare \
lxc-usernsexec \ lxc-usernsexec \
...@@ -231,6 +228,7 @@ lxc_monitord_SOURCES = lxc_monitord.c ...@@ -231,6 +228,7 @@ lxc_monitord_SOURCES = lxc_monitord.c
lxc_clone_SOURCES = lxc_clone.c lxc_clone_SOURCES = lxc_clone.c
lxc_start_SOURCES = lxc_start.c lxc_start_SOURCES = lxc_start.c
lxc_stop_SOURCES = lxc_stop.c lxc_stop_SOURCES = lxc_stop.c
lxc_top_SOURCES = lxc_top.c
lxc_unfreeze_SOURCES = lxc_unfreeze.c lxc_unfreeze_SOURCES = lxc_unfreeze.c
lxc_unshare_SOURCES = lxc_unshare.c lxc_unshare_SOURCES = lxc_unshare.c
lxc_wait_SOURCES = lxc_wait.c lxc_wait_SOURCES = lxc_wait.c
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment