memsparkline


Namememsparkline JSON
Version 0.5.1 PyPI version JSON
download
home_pagehttps://gitlab.com/dbohdan/memsparkline
SummaryTrack the RAM usage (resident set size) of a process and its descendants in real time.
upload_time2024-01-08 15:19:37
maintainer
docs_urlNone
authorD. Bohdan
requires_python>=3.7,<4.0
licenseMIT
keywords memory monitoring performance ram resident set size sparklines
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # memsparkline

Track the RAM usage ([resident set size](https://en.wikipedia.org/wiki/Resident_set_size)) of a process, its children, its children's children, etc. in real time with a Unicode text [sparkline](https://en.wikipedia.org/wiki/Sparkline). See the average and the maximum usage after the process exits, as well as the run time.



## Examples

```none
> memsparkline -- chromium-browser --incognito http://localhost:8081/
▁▁▁▁▄▇▇▇█ 789.5
 avg: 371.0
 max: 789.5
time: 0:00:12.0
```

```none
> memsparkline -n -o log du /usr/ >/dev/null 2>&1 &
> tail -f log
█ 2.8
▆█ 3.3
▆▇█ 3.6
▆▇▇█ 3.9
▆▇▇█▆ 3.3
▆▇▇█▆▆ 3.3
▆▇▇█▆▆▆ 3.3
▆▇▇█▆▆▆▆ 3.3
▄▅▅▆▅▅▅▅█ 5.2
▄▅▅▆▅▅▅▅██ 5.2
 avg: 3.7
 max: 5.2
time: 0:00:10.1
```


## Compatibility and limitations

memsparkline works on POSIX systems supported by [psutil](https://github.com/giampaolo/psutil). It has been tested on Debian, Ubuntu, FreeBSD, NetBSD, and OpenBSD. It seems to work on Windows, but Windows support has received minimal testing. The sparkline displays incorrectly in the Command Prompt and [ConEmu](https://conemu.github.io/) on Windows 7 with the stock console fonts but correctly on Windows 10 with the font NSimSun.

memsparkline measures run time less precisely than time(1). The granularity with which it measures run time depends on the `--wait` option.


## Installation

memsparkline requires Python 3.7 or later.

### Installing from PyPI

The recommended way to install memsparkline is [from PyPI](https://pypi.org/project/memsparkline/) with [pipx](https://github.com/pypa/pipx).

```sh
pipx install memsparkline
```

You can also use pip:

```sh
pip install --user memsparkline
```

### Manual installation

1. Install the dependencies from package repositories for your OS. You will find instructions for some operating systems below.
2. Download `src/memsparkline/main.py` and copy it to a directory in `PATH` as `memsparkline`. For example,

```sh
git clone https://gitlab.com/dbohdan/memsparkline
cd memsparkline
sudo install src/memsparkline/main.py /usr/local/bin/memsparkline
```

#### Dependencies

##### Debian/Ubuntu

```sh
sudo apt install python3-psutil
```

##### DragonFly BSD 6.6, FreeBSD 13.1

```sh
sudo pkg install py39-psutil
```

##### NetBSD 9.3

```sh
sudo pkgin in py310-psutil
```

##### OpenBSD

```sh
doas pkg_add py3-psutil
```


## Usage

```none
usage: memsparkline [-h] [-v] [-d path] [-l n] [-m fmt] [-n] [-o path] [-q]
                    [-t fmt] [-w ms]
                    command ...

Track the RAM usage (resident set size) of a process and its descendants in
real time.

positional arguments:
  command               command to run
  arg                   arguments to command

options:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -d path, --dump path  file to which to write full memory usage history when
                        finished
  -l n, --length n      sparkline length (default: 20)
  -m fmt, --mem-format fmt
                        format string for memory amounts (default: "%0.1f")
  -n, --newlines        print new sparkline on new line instead of over
                        previous
  -o path, --output path
                        output file to append to ("-" for standard error)
  -q, --quiet           do not print sparklines, only final report
  -t fmt, --time-format fmt
                        format string for run time (default: "%d:%02d:%04.1f")
  -w ms, --wait ms      how long to wait between taking samples (default:
                        1000)
```


## License

MIT.


## See also

memusg and spark inspired this project.

### Tracking  memory usage

* [DragonFly BSD](https://man.dragonflybsd.org/?command=time&section=ANY), [FreeBSD](https://man.freebsd.org/cgi/man.cgi?query=time&format=html), [NetBSD](https://man.netbsd.org/time.1), [OpenBSD](https://man.openbsd.org/time), and [macOS](https://ss64.com/osx/time.html) time(1) flag `-l`.
* [GNU time(1)](https://linux.die.net/man/1/time) flag `-v`.
* [memusg](http://gist.github.com/526585) — a Bash script for FreeBSD, Linux, and macOS that measures the peak resident set size of a process.

### Sparklines

* [spark](https://github.com/holman/spark) — a Bash script that generates a Unicode text sparkline from a list of numbers.
* [sparkline.tcl](https://wiki.tcl-lang.org/page/Sparkline) — a Tcl script by the developer of this project that does the same. Adds a `--min` and `--max` option for setting the scale.

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/dbohdan/memsparkline",
    "name": "memsparkline",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7,<4.0",
    "maintainer_email": "",
    "keywords": "memory,monitoring,performance,RAM,resident set size,sparklines",
    "author": "D. Bohdan",
    "author_email": "dbohdan@dbohdan.com",
    "download_url": "https://files.pythonhosted.org/packages/8e/5d/89530f054e60bb5c9a18a1e24dcb12d304d1285438f2d94f33408c4d2082/memsparkline-0.5.1.tar.gz",
    "platform": null,
    "description": "# memsparkline\n\nTrack the RAM usage ([resident set size](https://en.wikipedia.org/wiki/Resident_set_size)) of a process, its children, its children's children, etc. in real time with a Unicode text [sparkline](https://en.wikipedia.org/wiki/Sparkline). See the average and the maximum usage after the process exits, as well as the run time.\n\n\n\n## Examples\n\n```none\n> memsparkline -- chromium-browser --incognito http://localhost:8081/\n\u2581\u2581\u2581\u2581\u2584\u2587\u2587\u2587\u2588 789.5\n avg: 371.0\n max: 789.5\ntime: 0:00:12.0\n```\n\n```none\n> memsparkline -n -o log du /usr/ >/dev/null 2>&1 &\n> tail -f log\n\u2588 2.8\n\u2586\u2588 3.3\n\u2586\u2587\u2588 3.6\n\u2586\u2587\u2587\u2588 3.9\n\u2586\u2587\u2587\u2588\u2586 3.3\n\u2586\u2587\u2587\u2588\u2586\u2586 3.3\n\u2586\u2587\u2587\u2588\u2586\u2586\u2586 3.3\n\u2586\u2587\u2587\u2588\u2586\u2586\u2586\u2586 3.3\n\u2584\u2585\u2585\u2586\u2585\u2585\u2585\u2585\u2588 5.2\n\u2584\u2585\u2585\u2586\u2585\u2585\u2585\u2585\u2588\u2588 5.2\n avg: 3.7\n max: 5.2\ntime: 0:00:10.1\n```\n\n\n## Compatibility and limitations\n\nmemsparkline works on POSIX systems supported by [psutil](https://github.com/giampaolo/psutil). It has been tested on Debian, Ubuntu, FreeBSD, NetBSD, and OpenBSD. It seems to work on Windows, but Windows support has received minimal testing. The sparkline displays incorrectly in the Command Prompt and [ConEmu](https://conemu.github.io/) on Windows 7 with the stock console fonts but correctly on Windows 10 with the font NSimSun.\n\nmemsparkline measures run time less precisely than time(1). The granularity with which it measures run time depends on the `--wait` option.\n\n\n## Installation\n\nmemsparkline requires Python 3.7 or later.\n\n### Installing from PyPI\n\nThe recommended way to install memsparkline is [from PyPI](https://pypi.org/project/memsparkline/) with [pipx](https://github.com/pypa/pipx).\n\n```sh\npipx install memsparkline\n```\n\nYou can also use pip:\n\n```sh\npip install --user memsparkline\n```\n\n### Manual installation\n\n1. Install the dependencies from package repositories for your OS. You will find instructions for some operating systems below.\n2. Download `src/memsparkline/main.py` and copy it to a directory in `PATH` as `memsparkline`. For example,\n\n```sh\ngit clone https://gitlab.com/dbohdan/memsparkline\ncd memsparkline\nsudo install src/memsparkline/main.py /usr/local/bin/memsparkline\n```\n\n#### Dependencies\n\n##### Debian/Ubuntu\n\n```sh\nsudo apt install python3-psutil\n```\n\n##### DragonFly BSD 6.6, FreeBSD 13.1\n\n```sh\nsudo pkg install py39-psutil\n```\n\n##### NetBSD 9.3\n\n```sh\nsudo pkgin in py310-psutil\n```\n\n##### OpenBSD\n\n```sh\ndoas pkg_add py3-psutil\n```\n\n\n## Usage\n\n```none\nusage: memsparkline [-h] [-v] [-d path] [-l n] [-m fmt] [-n] [-o path] [-q]\n                    [-t fmt] [-w ms]\n                    command ...\n\nTrack the RAM usage (resident set size) of a process and its descendants in\nreal time.\n\npositional arguments:\n  command               command to run\n  arg                   arguments to command\n\noptions:\n  -h, --help            show this help message and exit\n  -v, --version         show program's version number and exit\n  -d path, --dump path  file to which to write full memory usage history when\n                        finished\n  -l n, --length n      sparkline length (default: 20)\n  -m fmt, --mem-format fmt\n                        format string for memory amounts (default: \"%0.1f\")\n  -n, --newlines        print new sparkline on new line instead of over\n                        previous\n  -o path, --output path\n                        output file to append to (\"-\" for standard error)\n  -q, --quiet           do not print sparklines, only final report\n  -t fmt, --time-format fmt\n                        format string for run time (default: \"%d:%02d:%04.1f\")\n  -w ms, --wait ms      how long to wait between taking samples (default:\n                        1000)\n```\n\n\n## License\n\nMIT.\n\n\n## See also\n\nmemusg and spark inspired this project.\n\n### Tracking  memory usage\n\n* [DragonFly BSD](https://man.dragonflybsd.org/?command=time&section=ANY), [FreeBSD](https://man.freebsd.org/cgi/man.cgi?query=time&format=html), [NetBSD](https://man.netbsd.org/time.1), [OpenBSD](https://man.openbsd.org/time), and [macOS](https://ss64.com/osx/time.html) time(1) flag `-l`.\n* [GNU time(1)](https://linux.die.net/man/1/time) flag `-v`.\n* [memusg](http://gist.github.com/526585) \u2014 a Bash script for FreeBSD, Linux, and macOS that measures the peak resident set size of a process.\n\n### Sparklines\n\n* [spark](https://github.com/holman/spark) \u2014 a Bash script that generates a Unicode text sparkline from a list of numbers.\n* [sparkline.tcl](https://wiki.tcl-lang.org/page/Sparkline) \u2014 a Tcl script by the developer of this project that does the same. Adds a `--min` and `--max` option for setting the scale.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Track the RAM usage (resident set size) of a process and its descendants in real time.",
    "version": "0.5.1",
    "project_urls": {
        "Homepage": "https://gitlab.com/dbohdan/memsparkline",
        "Repository": "https://gitlab.com/dbohdan/memsparkline"
    },
    "split_keywords": [
        "memory",
        "monitoring",
        "performance",
        "ram",
        "resident set size",
        "sparklines"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5cd2f1729c57af46950b8d9b277fe3815a2fce707416a82d6422f30cf3a905e6",
                "md5": "dce5f742ad662d6b598a15a4b8c7937d",
                "sha256": "27001219d951848441f10babc4c78aa746ef0baaa24f3da0b36a7f4cc02ae280"
            },
            "downloads": -1,
            "filename": "memsparkline-0.5.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "dce5f742ad662d6b598a15a4b8c7937d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7,<4.0",
            "size": 7948,
            "upload_time": "2024-01-08T15:19:33",
            "upload_time_iso_8601": "2024-01-08T15:19:33.766871Z",
            "url": "https://files.pythonhosted.org/packages/5c/d2/f1729c57af46950b8d9b277fe3815a2fce707416a82d6422f30cf3a905e6/memsparkline-0.5.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8e5d89530f054e60bb5c9a18a1e24dcb12d304d1285438f2d94f33408c4d2082",
                "md5": "48cf4d35eba2e0a34eeaec45b46160e0",
                "sha256": "3460a0be1fcf9a6c2890c091be53d983df66a691a0e37f1454f5206792575033"
            },
            "downloads": -1,
            "filename": "memsparkline-0.5.1.tar.gz",
            "has_sig": false,
            "md5_digest": "48cf4d35eba2e0a34eeaec45b46160e0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7,<4.0",
            "size": 10004,
            "upload_time": "2024-01-08T15:19:37",
            "upload_time_iso_8601": "2024-01-08T15:19:37.148700Z",
            "url": "https://files.pythonhosted.org/packages/8e/5d/89530f054e60bb5c9a18a1e24dcb12d304d1285438f2d94f33408c4d2082/memsparkline-0.5.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-08 15:19:37",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "dbohdan",
    "gitlab_project": "memsparkline",
    "lcname": "memsparkline"
}
        
Elapsed time: 0.16248s