Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hhxsv5/redis-memory-analysis
🔎 Analyzing memory of redis is to find the keys(prefix) which used a lot of memory, export the analysis result into csv file.
https://github.com/hhxsv5/redis-memory-analysis
analysis export-csvfile memory occupancy redis usage
Last synced: 8 days ago
JSON representation
🔎 Analyzing memory of redis is to find the keys(prefix) which used a lot of memory, export the analysis result into csv file.
- Host: GitHub
- URL: https://github.com/hhxsv5/redis-memory-analysis
- Owner: hhxsv5
- License: mit
- Created: 2017-11-13T08:47:27.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-25T13:15:57.000Z (over 6 years ago)
- Last Synced: 2024-03-29T22:03:47.296Z (8 months ago)
- Topics: analysis, export-csvfile, memory, occupancy, redis, usage
- Language: PHP
- Homepage: http://blog.sina.com.cn/s/blog_9bbafb790102x2sd.html
- Size: 191 KB
- Stars: 32
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Redis memory analysis
======🔎 Analyzing memory of redis is to find the keys(prefix) which used a lot of memory, export the analysis result into csv file.
## Requirements
* PHP 5.4 or later
* ext-redis >=2.2.8
* predis/predis ~1.1.0## Installation via Composer([packagist](https://packagist.org/packages/hhxsv5/redis-memory-analysis))
```BASH
composer require "hhxsv5/redis-memory-analysis:~1.0" -vvv
```## Usage
### Run demo```PHP
include '../vendor/autoload.php';use Hhxsv5\RMA\AnalyzeRedis;
$analyze = new AnalyzeRedis('127.0.0.1', 6379, '123456');
//Scan the keys which can be split by '#' ':'
//special pattern characters need to escape by '\'
$analyze->start(['#', ':']);//Find the csv file in default target folder: ./reports
//CSV file name format: redis-analysis-{host}-{port}-{db}.csv
//The keys order by count desc
$analyze->saveReport();
```![CSV](https://raw.githubusercontent.com/hhxsv5/redis-memory-analysis/master/examples/demo.png)
## License
[MIT](https://github.com/hhxsv5/redis-memory-analysis/blob/master/LICENSE)