PHP code example of hhxsv5 / redis-memory-analysis
1. Go to this page and download the library: Download hhxsv5/redis-memory-analysis library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
hhxsv5 / redis-memory-analysis example snippets
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();