New Upstream Snapshot - ctop

Ready changes

Summary

Merged new upstream version: 1.0.0+git20170914.1.1f79336 (was: 1.0.0).

Resulting package

Built on 2022-04-21T03:50 (took 14m56s)

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-snapshots ctop

Lintian Result

Diff

diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 4a812d2..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-# Temp files
-*.swp
-*.pyc
-
-# Build artefacts
-build
-*.egg-info
-dist
-
diff --git a/CHANGELOG b/CHANGELOG
deleted file mode 100644
index 5cec715..0000000
--- a/CHANGELOG
+++ /dev/null
@@ -1,76 +0,0 @@
-CHANGELOG
-#########
-
-v1.0.0 (2016-05-13)
-======
-
- - feat: add openvz support
- - feat: add pids cgroup support (max tasks)
- - feat: scroll
- - feat: repaint screen on resize
- - feat: use Docker container names if possible
- - improv: systemd integration
- - improv: docker image
- - fix: use relative path to 'which' (#7)
- - fix: crash when task is not present in cpuacct controller (#9)
- - fix: fix crash on terminals which do not support invisible cursors
- - fix: workaround broken blkio on some system
-
-v0.4.1 (2015-05-14)
-======
-
- - feat: Python 3 support (@NicolasLM)
- - feat: fold/unfold cgroup tree
- - feat: hint/error message when no cgroup is found and boot2docker is installed
- - fix \#3: crash when no cgroup is located
- - fix: docker detection + actions under systemd
-
-v0.4.0 (2015-04-19)
-======
-
- - feat: detect container system type (docker, systemd, lxc)
- - feat: attach, enter, stop, kill supported containers
- - feat: select container / follow container
- - fix: mutiple crashes related to small screens
- - fix: tree render
- - enhancement: rewrite README
- - enhancement: drop 'docopt' dependency
-
-v0.3.1
-======
-
- - enhancement: drop 'psutil' dependency
- - enhancement: python 2.6 compatibility
- - fix: phantom container lines after cgroup termination
- - doc: add screenshot
-
-v0.3.0
-======
-
- - add command line
- - add choose columns, sort columns from command line
- - add choose refresh rate from command line
- - add tree view + toggle from cmdline + toggle from keyboard
- - add pause mode to ease text selections
- - add status bar
- - add CHANGELOG
- - fix parse of 1-line dict-like cgroup pseudo-files
- - drop peak memory usage column, meaningless in practise
-
-v0.2.0
-======
-
- - add blkio bw column
- - add time column
- - enhancement: header contrast
- - enhancement: remove 1st header line
- - enhancement: header contrast
- - add sort toggle on click
- - highlight sort column
- - exit with 'q'
-
-v0.1.0
-======
-
-Initial release
-
diff --git a/Dockerfile b/Dockerfile
deleted file mode 100644
index 0e60b87..0000000
--- a/Dockerfile
+++ /dev/null
@@ -1,9 +0,0 @@
-FROM python:2-alpine
-MAINTAINER Jean-Tiare Le Bigot <jt@yadutaf.fr>
-
-# Ctop is a single file programa. Just copy it
-COPY cgroup_top.py /app/
-
-ENTRYPOINT ["python", "/app/cgroup_top.py"]
-CMD []
-
diff --git a/PKG-INFO b/PKG-INFO
new file mode 100644
index 0000000..db2be12
--- /dev/null
+++ b/PKG-INFO
@@ -0,0 +1,171 @@
+Metadata-Version: 2.1
+Name: ctop
+Version: 1.0.0
+Summary: A lightweight top like monitor for linux CGroups
+Home-page: https://github.com/yadutaf/ctop
+Author: Jean-Tiare Le Bigot
+Author-email: jt@yadutaf.fr
+License: MIT
+Platform: any
+Classifier: Environment :: Console
+Classifier: Environment :: Console :: Curses
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: Intended Audience :: Developers
+Classifier: Intended Audience :: System Administrators
+Classifier: Topic :: System :: Monitoring
+Classifier: License :: OSI Approved :: MIT License
+Classifier: Programming Language :: Python :: 2.6
+Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: 3
+License-File: LICENSE
+
+CTOP
+====
+
+A command line / text based Linux Containers monitoring tool that works just like you expect.
+
+.. image:: https://github.com/yadutaf/ctop/raw/master/screenshots/screenshot.png
+
+In a hurry?
+
+.. code:: bash
+
+    curl -sSl https://raw.githubusercontent.com/yadutaf/ctop/master/cgroup_top.py > /opt/ctop && python /opt/ctop
+
+Introduction
+------------
+
+``ctop`` will help you see what's going on at the container level. Basically,
+containers are a logical group of processes isolated using kernel's cgroups and
+namespaces. Recently, they have been made popular by Docker and they are also
+heavily used under the hood by systemd and a load of container tools like lxc,
+rocket, lmctfy and many others.
+
+Under the hood, ctop will collect all metrics it can from cgroups in realtime
+and render them to instantly give you an overview of the global system health.
+
+It currently collects metrics related to cpu, memory and block IO usage as well
+as metadata such as owning user (mostly for systemd based containers), uptime
+and attempts to guess the container managing technology behind.
+
+When the container technology has been successfully guessed, additional features
+are exposed like attaching to container (basically, it opens a shell in the
+container context) and stopping it.
+
+``ctop`` author uses it on production system to quicky detect biggest memory
+users in low memory situations.
+
+Features
+--------
+
+- collect cpu, pids, memory and blkio metrics
+- collect metadata like task count, owning user, container technology
+- sort by any column
+- filter by container type (docker, lxc, systemd, ...)
+- optionally display logical/tree view
+- optionally fold/unfold sub cgroup tree
+- optionally follow selected cgroup/container
+- optionnaly pause the refresh (typically, to select text)
+- detects Docker, LXC, unprivileged LXC, OpenVZ and systemd based containers
+- supports advanced features for Docker, LXC and OpenVZ based containers
+- detects qemu-kvm virtual machines (with libvirt only)
+- supports advanced features for qemu-kvm VMs (via virsh)
+- open a shell/attach to supported container types for further diagnose
+- stop/kill/chekpointing supported container types
+- click to sort / reverse
+- click to select cgroup
+- no external dependencies beyond Python >= 2.6 or Python >= 3.0
+
+> Note: since 2017-07-27, the reported memory will exclude cache memory to
+> align on Docker design decision.
+
+Installation
+------------
+
+As a monitoring tool, ``ctop`` tries to be as discreet as possible. Nonetheless
+it still has some expectations. It will need at least Python 2.6 with builtin
+curses support to run. This is usually found with Debian 6 and newer.
+
+This said, the recommended installation method relies on pip
+
+.. code:: bash
+
+  pip install ctop
+  ctop
+
+If using pip is not an option, which is often the case on production systems,
+you may also directly grab the self-contained source file directly from github
+and run it in place. All you'll need is Python 2.6 (Debian Squeeze):
+
+.. code:: bash
+
+  wget https://raw.githubusercontent.com/yadutaf/ctop/master/cgroup_top.py -O ctop
+  chmod +x ctop
+  ./ctop
+
+Alternatively, if you are a Boot2docker user, you may install a Dockerized
+version of ctop instead. Please note that this is experimental. You have to
+have a docker binary inside your container to control / attach to your
+containers from ctop using this method:
+
+.. code:: bash
+
+  docker pull yadutaf/ctop
+  docker run --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro --volume=/var/run/docker.sock:/var/run/docker.sock -it --rm yadutaf/ctop
+  # Optionally, to resolve uids to usernames, add '--volume /etc/passwd:/etc/passwd:ro'
+
+Usage
+-----
+
+**Command line**:
+
+.. code:: text
+
+  Monitor local cgroups as used by Docker, LXC, SystemD, ...
+
+  Usage:
+    ctop [--tree] [--refresh=<seconds>] [--columns=<columns>] [--sort-col=<sort-col>] [--follow=<name>] [--fold=<cgroup>, ...] [--type=<container type>, ...]
+    ctop (-h | --help)
+
+  Options:
+    --tree                 Show tree view by default.
+    --fold=<name>          Start with <name> cgroup path folded
+    --follow=<name>        Follow/highlight cgroup at path.
+    --type=TYPE            Only show containers of this type
+    --refresh=<seconds>    Refresh display every <seconds> [default: 1].
+    --columns=<columns>    List of optional columns to display. Always includes 'name'. [default: owner,processes,memory,cpu-sys,cpu-user,blkio,cpu-time].
+    --sort-col=<sort-col>  Select column to sort by initially. Can be changed dynamically. [default: cpu-user]
+    -h --help              Show this screen.
+
+
+**Control**:
+
+- press ``p`` to toggle/pause the refresh and select text.
+- press ``f`` to let selected line follow / stay on the same container. Default: Don't follow.
+- press ``q`` or ``Ctrl+C`` to quit.
+- press ``F5`` to toggle tree/list view. Default: list view.
+- press ``↑`` and ``↓`` to navigate between containers.
+- press ``+`` or ``-`` to toggle child cgroup folding
+- click on title line to select sort column / reverse sort order.
+- click on any container line to select it.
+
+Additionally, for supported container types (Currently Docker, LXC and OpenVZ):
+
+- press ``a`` to attach to console output.
+- press ``e`` to open a shell in the container context. Aka 'enter' container.
+- press ``s`` to stop the container (SIGTERM).
+- press ``k`` to kill the container (SIGKILL).
+- press ``c`` to checkpointing the container(OpenVZ only now - run 'vzctl chkpnt CTID')
+
+Requirements
+------------
+
+* python >=2.6 or python >=3.0, with builtin curses support
+
+Licence
+-------
+
+MIT
+
+
+
diff --git a/README.rst b/README.rst
index 01b42ea..9b92193 100644
--- a/README.rst
+++ b/README.rst
@@ -47,16 +47,21 @@ Features
 - optionnaly pause the refresh (typically, to select text)
 - detects Docker, LXC, unprivileged LXC, OpenVZ and systemd based containers
 - supports advanced features for Docker, LXC and OpenVZ based containers
+- detects qemu-kvm virtual machines (with libvirt only)
+- supports advanced features for qemu-kvm VMs (via virsh)
 - open a shell/attach to supported container types for further diagnose
 - stop/kill/chekpointing supported container types
 - click to sort / reverse
 - click to select cgroup
 - no external dependencies beyond Python >= 2.6 or Python >= 3.0
 
+> Note: since 2017-07-27, the reported memory will exclude cache memory to
+> align on Docker design decision.
+
 Installation
 ------------
 
-As a monitoring tool, ``ctop`` tries to be as dicrete as possible. Nonetheless
+As a monitoring tool, ``ctop`` tries to be as discreet as possible. Nonetheless
 it still has some expectations. It will need at least Python 2.6 with builtin
 curses support to run. This is usually found with Debian 6 and newer.
 
@@ -93,6 +98,8 @@ Usage
 
 **Command line**:
 
+.. code:: text
+
   Monitor local cgroups as used by Docker, LXC, SystemD, ...
 
   Usage:
diff --git a/cgroup_top.py b/cgroup_top.py
index 560d837..d3eaa44 100755
--- a/cgroup_top.py
+++ b/cgroup_top.py
@@ -54,6 +54,7 @@ HAS_LXC = cmd_exists('lxc-start')
 HAS_DOCKER = cmd_exists('docker')
 HAS_OPENVZ = cmd_exists('vzctl')
 regexp_ovz_container = re.compile('^/\d+$')
+HAS_LIBVIRT = cmd_exists('virsh')
 
 
 HIDE_EMPTY_CGROUP = True
@@ -156,6 +157,15 @@ def docker_container_name(container_id, default, cache=dict()):
     cache[container_id] = default
     return default
 
+def libvirt_vm_name(cgroup_line):
+    # Get VM name from cgroup line like
+    # /machine.slice/machine-qemu\x2d305\x2d121487.scope/emulator
+    cgroup_line = cgroup_line.replace('/machine.slice/machine-qemu','')
+    splited_line = cgroup_line.split('.scope')
+    if len(splited_line) < 1: 
+        return ''
+    splited_line = splited_line[0].split("\\x2d")
+    return splited_line[len(splited_line)-1]
 
 def to_human(num, suffix='B'):
     num = int(num)
@@ -286,6 +296,8 @@ class Cgroup(object):
             return 'systemd'
         elif path == '/user.slice' or path == '/system.slice' or path.startswith('/system.slice/'):
             return 'systemd'
+        elif path.startswith('/machine.slice/machine-qemu'):
+            return 'qemu-kvm'
         elif regexp_ovz_container.match(path) and path != '/0' and HAS_OPENVZ:
             return 'openvz'
         else:
@@ -431,7 +443,8 @@ def collect(measures):
         # list all "folders" under mountpoint
         for cgroup in cgroups(CGROUP_MOUNTPOINTS['memory']):
             collect_ensure_common(cur[cgroup.name], cgroup)
-            cur[cgroup.name]['memory.usage_in_bytes'] = cgroup['memory.usage_in_bytes']
+            cache = cgroup['memory.stat']['cache']
+            cur[cgroup.name]['memory.usage_in_bytes'] = cgroup['memory.usage_in_bytes'] - cache
             cur[cgroup.name]['memory.limit_in_bytes'] = min(int(cgroup['memory.limit_in_bytes']), measures['global']['total_memory'])
 
     # Collect PIDs constraints. Root cgroup does *not* have the controller files
@@ -606,18 +619,23 @@ def display(scr, results, conf):
     CONFIGURATION['cgroups'] = [cgroup['cgroup'] for cgroup in results]
 
     # Ensure selected line name synced with num
-    if CONFIGURATION['follow']:
-        while True:
-            try:
-                i = CONFIGURATION['cgroups'].index(CONFIGURATION['selected_line_name'])
-                CONFIGURATION['selected_line_num'] = i
-                break
-            except:
-                CONFIGURATION['selected_line_name'] = os.path.dirname(CONFIGURATION['selected_line_name'])
+    if results:
+        if CONFIGURATION['follow']:
+            while True:
+                try:
+                    i = CONFIGURATION['cgroups'].index(CONFIGURATION['selected_line_name'])
+                    CONFIGURATION['selected_line_num'] = i
+                    break
+                except:
+                    CONFIGURATION['selected_line_name'] = os.path.dirname(CONFIGURATION['selected_line_name'])
+        else:
+            CONFIGURATION['selected_line_num'] = min(len(results)-1, CONFIGURATION['selected_line_num'])
+            CONFIGURATION['selected_line_name'] = CONFIGURATION['cgroups'][CONFIGURATION['selected_line_num']]
+        CONFIGURATION['selected_line'] = results[CONFIGURATION['selected_line_num']]
     else:
-        CONFIGURATION['selected_line_num'] = min(len(results)-1, CONFIGURATION['selected_line_num'])
-        CONFIGURATION['selected_line_name'] = CONFIGURATION['cgroups'][CONFIGURATION['selected_line_num']]
-    CONFIGURATION['selected_line'] = results[CONFIGURATION['selected_line_num']]
+        CONFIGURATION['selected_line_num'] = 0
+        CONFIGURATION['selected_line_name'] = ''
+        CONFIGURATION['selected_line'] = None
 
     # Get display informations
     height, width = scr.getmaxyx()
@@ -708,7 +726,7 @@ def display(scr, results, conf):
             # Last char wraps, on purpose: draw full line
             pass
 
-        selected = results[CONFIGURATION['selected_line_num']]
+        selected = results[CONFIGURATION['selected_line_num']] if results else {}
 
         scr.addstr(height-1, 0, " CTOP ", color)
         scr.addch(curses.ACS_VLINE, color)
@@ -721,16 +739,19 @@ def display(scr, results, conf):
 
         # Fold control
         if CONFIGURATION['tree']:
-            scr.addstr(" [+/-] %s "%('unfold' if selected['cgroup'] in CONFIGURATION['fold'] else 'fold'), color)
+            scr.addstr(" [+/-] %s "%('unfold' if selected.get('cgroup', '') in CONFIGURATION['fold'] else 'fold'), color)
             scr.addch(curses.ACS_VLINE, color)
 
         # Do we have any actions available for *selected* line ?
-        selected_type = selected['type']
+        selected_type = selected.get('type', '')
         if selected_type == 'docker' and HAS_DOCKER or \
            selected_type in ['lxc', 'lxc-user'] and HAS_LXC or \
+           selected_type == 'qemu-kvm' and HAS_LIBVIRT or \
            selected_type == 'openvz' and HAS_OPENVZ:
              if selected_type == 'openvz':
                 scr.addstr(" [A]ttach, [E]nter, [S]top, [C]hkpnt, [K]ill ", color)
+             elif selected_type == 'qemu-kvm':
+                scr.addstr(" [A]ttach, [S]top, [K]ill ", color)
              else:
                 scr.addstr(" [A]ttach, [E]nter, [S]top, [K]ill ", color)
              scr.addch(curses.ACS_VLINE, color)
@@ -757,6 +778,30 @@ def on_keyboard(c):
     elif c == ord('f'):
         CONFIGURATION['follow'] = not CONFIGURATION['follow']
         return 2
+    elif c == 269: # F5
+        CONFIGURATION['tree'] = not CONFIGURATION['tree']
+        return 2
+    elif c == curses.KEY_DOWN:
+        if CONFIGURATION['follow']:
+            i = CONFIGURATION['cgroups'].index(CONFIGURATION['selected_line_name'])
+        else:
+            i = CONFIGURATION['selected_line_num']
+        i = min(i+1, len(CONFIGURATION['cgroups'])-1)
+        CONFIGURATION['selected_line_num'] = i
+        CONFIGURATION['selected_line_name'] = CONFIGURATION['cgroups'][i]
+        return 2
+    elif c == curses.KEY_UP:
+        if CONFIGURATION['follow']:
+            i = CONFIGURATION['cgroups'].index(CONFIGURATION['selected_line_name'])
+        else:
+            i = CONFIGURATION['selected_line_num']
+        i = max(i-1, 0)
+        CONFIGURATION['selected_line_num'] = i
+        CONFIGURATION['selected_line_name'] = CONFIGURATION['cgroups'][i]
+        return 2
+    elif CONFIGURATION['selected_line'] is None:
+        # All following lines expect a valid selected line
+        return 2
     elif c == ord('+') or c == ord('-'):
         cgroup = CONFIGURATION['selected_line']['cgroup']
         if cgroup in CONFIGURATION['fold']:
@@ -776,6 +821,8 @@ def on_keyboard(c):
             run(selected['owner'], ['lxc-console', '--name', selected_name, '--', '/bin/bash'], interactive=True)
         elif selected['type'] == 'openvz' and HAS_OPENVZ:
             run(selected['owner'], ['vzctl', 'console', selected_name], interactive=True)
+        elif selected['type'] == 'qemu-kvm' and HAS_LIBVIRT:
+            run(selected['owner'], ['virsh', 'console', libvirt_vm_name(selected['cgroup']) ], interactive=True)
 
         return 2
     elif c == ord('e'):
@@ -804,6 +851,8 @@ def on_keyboard(c):
             run(selected['owner'], ['lxc-stop', '--name', selected_name, '--nokill', '--nowait'])
         elif selected['type'] == 'openvz' and HAS_OPENVZ:
             run(selected['owner'], ['vzctl', 'stop', selected_name])
+        elif selected['type'] == 'qemu-kvm' and HAS_LIBVIRT:
+            run(selected['owner'], ['virsh', 'shutdown', libvirt_vm_name(selected['cgroup']) ])
 
         return 1
     elif c == ord('c'):
@@ -826,29 +875,10 @@ def on_keyboard(c):
             run(selected['owner'], ['lxc-stop', '-k', '--name', selected_name, '--nowait'])
         elif selected['type'] == 'openvz' and HAS_OPENVZ:
             run(selected['owner'], ['vzctl', 'stop', selected_name, '--fast'])
+        elif selected['type'] == 'qemu-kvm' and HAS_LIBVIRT:
+            run(selected['owner'], ['virsh', 'destroy', libvirt_vm_name(selected['cgroup']) ])
 
         return 2
-    elif c == 269: # F5
-        CONFIGURATION['tree'] = not CONFIGURATION['tree']
-        return 2
-    elif c == curses.KEY_DOWN:
-        if CONFIGURATION['follow']:
-            i = CONFIGURATION['cgroups'].index(CONFIGURATION['selected_line_name'])
-        else:
-            i = CONFIGURATION['selected_line_num']
-        i = min(i+1, len(CONFIGURATION['cgroups'])-1)
-        CONFIGURATION['selected_line_num'] = i
-        CONFIGURATION['selected_line_name'] = CONFIGURATION['cgroups'][i]
-        return 2
-    elif c == curses.KEY_UP:
-        if CONFIGURATION['follow']:
-            i = CONFIGURATION['cgroups'].index(CONFIGURATION['selected_line_name'])
-        else:
-            i = CONFIGURATION['selected_line_num']
-        i = max(i-1, 0)
-        CONFIGURATION['selected_line_num'] = i
-        CONFIGURATION['selected_line_name'] = CONFIGURATION['cgroups'][i]
-        return 2
     return 1
 
 def on_mouse():
diff --git a/ctop.egg-info/PKG-INFO b/ctop.egg-info/PKG-INFO
new file mode 100644
index 0000000..db2be12
--- /dev/null
+++ b/ctop.egg-info/PKG-INFO
@@ -0,0 +1,171 @@
+Metadata-Version: 2.1
+Name: ctop
+Version: 1.0.0
+Summary: A lightweight top like monitor for linux CGroups
+Home-page: https://github.com/yadutaf/ctop
+Author: Jean-Tiare Le Bigot
+Author-email: jt@yadutaf.fr
+License: MIT
+Platform: any
+Classifier: Environment :: Console
+Classifier: Environment :: Console :: Curses
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: Intended Audience :: Developers
+Classifier: Intended Audience :: System Administrators
+Classifier: Topic :: System :: Monitoring
+Classifier: License :: OSI Approved :: MIT License
+Classifier: Programming Language :: Python :: 2.6
+Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: 3
+License-File: LICENSE
+
+CTOP
+====
+
+A command line / text based Linux Containers monitoring tool that works just like you expect.
+
+.. image:: https://github.com/yadutaf/ctop/raw/master/screenshots/screenshot.png
+
+In a hurry?
+
+.. code:: bash
+
+    curl -sSl https://raw.githubusercontent.com/yadutaf/ctop/master/cgroup_top.py > /opt/ctop && python /opt/ctop
+
+Introduction
+------------
+
+``ctop`` will help you see what's going on at the container level. Basically,
+containers are a logical group of processes isolated using kernel's cgroups and
+namespaces. Recently, they have been made popular by Docker and they are also
+heavily used under the hood by systemd and a load of container tools like lxc,
+rocket, lmctfy and many others.
+
+Under the hood, ctop will collect all metrics it can from cgroups in realtime
+and render them to instantly give you an overview of the global system health.
+
+It currently collects metrics related to cpu, memory and block IO usage as well
+as metadata such as owning user (mostly for systemd based containers), uptime
+and attempts to guess the container managing technology behind.
+
+When the container technology has been successfully guessed, additional features
+are exposed like attaching to container (basically, it opens a shell in the
+container context) and stopping it.
+
+``ctop`` author uses it on production system to quicky detect biggest memory
+users in low memory situations.
+
+Features
+--------
+
+- collect cpu, pids, memory and blkio metrics
+- collect metadata like task count, owning user, container technology
+- sort by any column
+- filter by container type (docker, lxc, systemd, ...)
+- optionally display logical/tree view
+- optionally fold/unfold sub cgroup tree
+- optionally follow selected cgroup/container
+- optionnaly pause the refresh (typically, to select text)
+- detects Docker, LXC, unprivileged LXC, OpenVZ and systemd based containers
+- supports advanced features for Docker, LXC and OpenVZ based containers
+- detects qemu-kvm virtual machines (with libvirt only)
+- supports advanced features for qemu-kvm VMs (via virsh)
+- open a shell/attach to supported container types for further diagnose
+- stop/kill/chekpointing supported container types
+- click to sort / reverse
+- click to select cgroup
+- no external dependencies beyond Python >= 2.6 or Python >= 3.0
+
+> Note: since 2017-07-27, the reported memory will exclude cache memory to
+> align on Docker design decision.
+
+Installation
+------------
+
+As a monitoring tool, ``ctop`` tries to be as discreet as possible. Nonetheless
+it still has some expectations. It will need at least Python 2.6 with builtin
+curses support to run. This is usually found with Debian 6 and newer.
+
+This said, the recommended installation method relies on pip
+
+.. code:: bash
+
+  pip install ctop
+  ctop
+
+If using pip is not an option, which is often the case on production systems,
+you may also directly grab the self-contained source file directly from github
+and run it in place. All you'll need is Python 2.6 (Debian Squeeze):
+
+.. code:: bash
+
+  wget https://raw.githubusercontent.com/yadutaf/ctop/master/cgroup_top.py -O ctop
+  chmod +x ctop
+  ./ctop
+
+Alternatively, if you are a Boot2docker user, you may install a Dockerized
+version of ctop instead. Please note that this is experimental. You have to
+have a docker binary inside your container to control / attach to your
+containers from ctop using this method:
+
+.. code:: bash
+
+  docker pull yadutaf/ctop
+  docker run --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro --volume=/var/run/docker.sock:/var/run/docker.sock -it --rm yadutaf/ctop
+  # Optionally, to resolve uids to usernames, add '--volume /etc/passwd:/etc/passwd:ro'
+
+Usage
+-----
+
+**Command line**:
+
+.. code:: text
+
+  Monitor local cgroups as used by Docker, LXC, SystemD, ...
+
+  Usage:
+    ctop [--tree] [--refresh=<seconds>] [--columns=<columns>] [--sort-col=<sort-col>] [--follow=<name>] [--fold=<cgroup>, ...] [--type=<container type>, ...]
+    ctop (-h | --help)
+
+  Options:
+    --tree                 Show tree view by default.
+    --fold=<name>          Start with <name> cgroup path folded
+    --follow=<name>        Follow/highlight cgroup at path.
+    --type=TYPE            Only show containers of this type
+    --refresh=<seconds>    Refresh display every <seconds> [default: 1].
+    --columns=<columns>    List of optional columns to display. Always includes 'name'. [default: owner,processes,memory,cpu-sys,cpu-user,blkio,cpu-time].
+    --sort-col=<sort-col>  Select column to sort by initially. Can be changed dynamically. [default: cpu-user]
+    -h --help              Show this screen.
+
+
+**Control**:
+
+- press ``p`` to toggle/pause the refresh and select text.
+- press ``f`` to let selected line follow / stay on the same container. Default: Don't follow.
+- press ``q`` or ``Ctrl+C`` to quit.
+- press ``F5`` to toggle tree/list view. Default: list view.
+- press ``↑`` and ``↓`` to navigate between containers.
+- press ``+`` or ``-`` to toggle child cgroup folding
+- click on title line to select sort column / reverse sort order.
+- click on any container line to select it.
+
+Additionally, for supported container types (Currently Docker, LXC and OpenVZ):
+
+- press ``a`` to attach to console output.
+- press ``e`` to open a shell in the container context. Aka 'enter' container.
+- press ``s`` to stop the container (SIGTERM).
+- press ``k`` to kill the container (SIGKILL).
+- press ``c`` to checkpointing the container(OpenVZ only now - run 'vzctl chkpnt CTID')
+
+Requirements
+------------
+
+* python >=2.6 or python >=3.0, with builtin curses support
+
+Licence
+-------
+
+MIT
+
+
+
diff --git a/ctop.egg-info/SOURCES.txt b/ctop.egg-info/SOURCES.txt
new file mode 100644
index 0000000..69e125d
--- /dev/null
+++ b/ctop.egg-info/SOURCES.txt
@@ -0,0 +1,9 @@
+LICENSE
+README.rst
+cgroup_top.py
+setup.py
+bin/ctop
+ctop.egg-info/PKG-INFO
+ctop.egg-info/SOURCES.txt
+ctop.egg-info/dependency_links.txt
+ctop.egg-info/top_level.txt
\ No newline at end of file
diff --git a/ctop.egg-info/dependency_links.txt b/ctop.egg-info/dependency_links.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/ctop.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/ctop.egg-info/top_level.txt b/ctop.egg-info/top_level.txt
new file mode 100644
index 0000000..9840192
--- /dev/null
+++ b/ctop.egg-info/top_level.txt
@@ -0,0 +1 @@
+cgroup_top
diff --git a/debian/changelog b/debian/changelog
index b6901e2..f0d38ba 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+ctop (1.0.0+git20170914.1.1f79336-1) UNRELEASED; urgency=low
+
+  * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Thu, 21 Apr 2022 03:43:29 -0000
+
 ctop (1.0.0-3) unstable; urgency=medium
 
   [ Ondřej Nový ]
diff --git a/requirements.txt b/requirements.txt
deleted file mode 100644
index e69de29..0000000
diff --git a/screenshots/screenshot.png b/screenshots/screenshot.png
deleted file mode 100644
index 0043cf4..0000000
Binary files a/screenshots/screenshot.png and /dev/null differ
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..8bfd5a1
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,4 @@
+[egg_info]
+tag_build = 
+tag_date = 0
+
diff --git a/setup.py b/setup.py
index 204b017..3bf87cf 100644
--- a/setup.py
+++ b/setup.py
@@ -1,9 +1,10 @@
 #!/usr/bin/env python
 
 import os
+from io import open
 from setuptools import setup
 
-with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f:
+with open(os.path.join(os.path.dirname(__file__), 'README.rst'), encoding='utf-8') as f:
     readme = f.read()
 
 setup(

Debdiff

[The following lists of changes regard files as different if they have different names, permissions or owners.]

Files in first set of .debs but not in second

-rw-r--r--  root/root   /usr/share/doc/ctop/changelog.gz

No differences were encountered in the control files

More details

Full run details