redis-key-analyzer


Nameredis-key-analyzer JSON
Version 0.1.3 PyPI version JSON
download
home_pageNone
SummaryRedis Key Analyzer is a CLI tool for scanning and analyzing Redis database keys, providing insights into their distribution, type, memory usage, and TTL.
upload_time2024-07-27 15:30:01
maintainerNone
docs_urlNone
authorRyan Kang
requires_python>=3.9
licenseNone
keywords redis pypi redis keys analyzer
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # redis-key-analyzer

## Overview

`redis-key-analyzer` is a tool designed to analyze Redis keys, providing detailed statistics on key patterns, memory usage, TTL (Time to Live), and more. This tool is useful for understanding the distribution and characteristics of keys in a Redis database, which can help in optimizing and managing Redis instances.

## Features

- Analyze Redis keys based on patterns, prefixes, and separators.
- Collect statistics on key types, memory usage, and TTL.
- Support for read-only Redis clusters.
- Configurable batch size and sleep intervals for large datasets.

## Installation

To install `redis-key-analyzer`, use pip:

```bash
pip install rka
```

## Usage

You can use the `redis-key-analyzer` via the command line interface (CLI). Below are the available options:

```bash
Usage: redis-key-analyzer [OPTIONS]

Options:
  --host TEXT          Redis host. Default is 'localhost'.
  --port INTEGER       Redis port. Default is 6379.
  --db INTEGER         Redis database. Default is 0.
  --read-only, -ro     Check read-only cluster.
  --match, -m TEXT     Redis key pattern. Default is '*'.
  --batch-size INTEGER Batch size. Default is 1000.
  --prefix TEXT        Prefixes for key pattern. Example: --prefix 'prefix1 prefix2'.
  --separator TEXT     Separators for key pattern. Default is ':'.
  --limit INTEGER      Limit total keys. -1 for no limit. Default is -1.
  --sleep INTEGER      Sleep seconds between batches. -1 for no sleep. Default is -1.
  --help               Show this message and exit.
```

Search 

```bash
rka --host localhost [--port 6379] [--db 0] [-m '*']

+-------------+--------+-------+---------+---------+-------+--------------+-----------+------------+------------+----------+----------+--------------+
| pattern     | dtype  |  ttl  | avg_ttl | max_ttl | count | total_memory | memory_hu | memory_avg | memory_max | size_avg | size_max | key(max_ttl) |
+-------------+--------+-------+---------+---------+-------+--------------+-----------+------------+------------+----------+----------+--------------+
| my-set      |  set   | NOTTL |    -1   |    -1   |   1   |          272 |  272.0  B |    272     |    272     |    3     |    3     | my-set       |
| my-list     |  list  | NOTTL |    -1   |    -1   |   1   |          223 |  223.0  B |    223     |    223     |    14    |    14    | my-list      |
| foos:<*>    | string |  TTL  |   524   |   984   |   3   |          183 |  183.0  B |     61     |     61     |    3     |    3     | foos:123     |
| my-hash     |  hash  | NOTTL |    -1   |    -1   |   1   |           87 |   87.0  B |     87     |     87     |    2     |    2     | my-hash      |
| my-zset     |  zset  | NOTTL |    -1   |    -1   |   1   |           83 |   83.0  B |     83     |     83     |    2     |    2     | my-zset      |
| user.sc:<*> |  hash  | NOTTL |    -1   |    -1   |   1   |           75 |   75.0  B |     75     |     75     |    1     |    1     | user.sc:123  |
| my-string   | string | NOTTL |    -1   |    -1   |   1   |           61 |   61.0  B |     61     |     61     |    3     |    3     | my-string    |
+-------------+--------+-------+---------+---------+-------+--------------+-----------+------------+------------+----------+----------+--------------+
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "redis-key-analyzer",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "redis, pypi, redis keys analyzer",
    "author": "Ryan Kang",
    "author_email": "serious8builder@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/8c/9b/06841a2aec9f0df7d85732de38a1b4a18b185430af596fd29f9f0778846a/redis-key-analyzer-0.1.3.tar.gz",
    "platform": null,
    "description": "# redis-key-analyzer\n\n## Overview\n\n`redis-key-analyzer` is a tool designed to analyze Redis keys, providing detailed statistics on key patterns, memory usage, TTL (Time to Live), and more. This tool is useful for understanding the distribution and characteristics of keys in a Redis database, which can help in optimizing and managing Redis instances.\n\n## Features\n\n- Analyze Redis keys based on patterns, prefixes, and separators.\n- Collect statistics on key types, memory usage, and TTL.\n- Support for read-only Redis clusters.\n- Configurable batch size and sleep intervals for large datasets.\n\n## Installation\n\nTo install `redis-key-analyzer`, use pip:\n\n```bash\npip install rka\n```\n\n## Usage\n\nYou can use the `redis-key-analyzer` via the command line interface (CLI). Below are the available options:\n\n```bash\nUsage: redis-key-analyzer [OPTIONS]\n\nOptions:\n  --host TEXT          Redis host. Default is 'localhost'.\n  --port INTEGER       Redis port. Default is 6379.\n  --db INTEGER         Redis database. Default is 0.\n  --read-only, -ro     Check read-only cluster.\n  --match, -m TEXT     Redis key pattern. Default is '*'.\n  --batch-size INTEGER Batch size. Default is 1000.\n  --prefix TEXT        Prefixes for key pattern. Example: --prefix 'prefix1 prefix2'.\n  --separator TEXT     Separators for key pattern. Default is ':'.\n  --limit INTEGER      Limit total keys. -1 for no limit. Default is -1.\n  --sleep INTEGER      Sleep seconds between batches. -1 for no sleep. Default is -1.\n  --help               Show this message and exit.\n```\n\nSearch \n\n```bash\nrka --host localhost [--port 6379] [--db 0] [-m '*']\n\n+-------------+--------+-------+---------+---------+-------+--------------+-----------+------------+------------+----------+----------+--------------+\n| pattern     | dtype  |  ttl  | avg_ttl | max_ttl | count | total_memory | memory_hu | memory_avg | memory_max | size_avg | size_max | key(max_ttl) |\n+-------------+--------+-------+---------+---------+-------+--------------+-----------+------------+------------+----------+----------+--------------+\n| my-set      |  set   | NOTTL |    -1   |    -1   |   1   |          272 |  272.0  B |    272     |    272     |    3     |    3     | my-set       |\n| my-list     |  list  | NOTTL |    -1   |    -1   |   1   |          223 |  223.0  B |    223     |    223     |    14    |    14    | my-list      |\n| foos:<*>    | string |  TTL  |   524   |   984   |   3   |          183 |  183.0  B |     61     |     61     |    3     |    3     | foos:123     |\n| my-hash     |  hash  | NOTTL |    -1   |    -1   |   1   |           87 |   87.0  B |     87     |     87     |    2     |    2     | my-hash      |\n| my-zset     |  zset  | NOTTL |    -1   |    -1   |   1   |           83 |   83.0  B |     83     |     83     |    2     |    2     | my-zset      |\n| user.sc:<*> |  hash  | NOTTL |    -1   |    -1   |   1   |           75 |   75.0  B |     75     |     75     |    1     |    1     | user.sc:123  |\n| my-string   | string | NOTTL |    -1   |    -1   |   1   |           61 |   61.0  B |     61     |     61     |    3     |    3     | my-string    |\n+-------------+--------+-------+---------+---------+-------+--------------+-----------+------------+------------+----------+----------+--------------+\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Redis Key Analyzer is a CLI tool for scanning and analyzing Redis database keys, providing insights into their distribution, type, memory usage, and TTL.",
    "version": "0.1.3",
    "project_urls": {
        "Source": "https://github.com/runnable38/redis-key-analyzer"
    },
    "split_keywords": [
        "redis",
        " pypi",
        " redis keys analyzer"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1d4b544c5f31ced803203c8b2c1c5ad9b032c48ae17945580ab62bee1cba349f",
                "md5": "6db18a2141b9e1bc1812b397549e6757",
                "sha256": "d018701a96298c839026d05d476e502af6272c7bd8c595d62f3da9565ffbe436"
            },
            "downloads": -1,
            "filename": "redis_key_analyzer-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6db18a2141b9e1bc1812b397549e6757",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 11318,
            "upload_time": "2024-07-27T15:30:00",
            "upload_time_iso_8601": "2024-07-27T15:30:00.001501Z",
            "url": "https://files.pythonhosted.org/packages/1d/4b/544c5f31ced803203c8b2c1c5ad9b032c48ae17945580ab62bee1cba349f/redis_key_analyzer-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8c9b06841a2aec9f0df7d85732de38a1b4a18b185430af596fd29f9f0778846a",
                "md5": "65f1b9b4146cdf5acc2ac637f1867445",
                "sha256": "89ecec70892b3853087887011ef17f1774ad6d86b831b0934b08c760ffbfa0ab"
            },
            "downloads": -1,
            "filename": "redis-key-analyzer-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "65f1b9b4146cdf5acc2ac637f1867445",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 10302,
            "upload_time": "2024-07-27T15:30:01",
            "upload_time_iso_8601": "2024-07-27T15:30:01.520075Z",
            "url": "https://files.pythonhosted.org/packages/8c/9b/06841a2aec9f0df7d85732de38a1b4a18b185430af596fd29f9f0778846a/redis-key-analyzer-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-27 15:30:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "runnable38",
    "github_project": "redis-key-analyzer",
    "github_not_found": true,
    "lcname": "redis-key-analyzer"
}
        
Elapsed time: 0.42205s