Releases: HDT3213/rdb
v1.3.2
🔥 Hot Key Analysis (-c hotkey) | Hot Key 分析
New hotkey command to find the hottest N keys by LFU frequency from an RDB file.
新增 hotkey 命令,支持从 RDB 文件中按 LFU 频率查找最热的 N 个 Key。
Prerequisites: The Redis instance must be configured with LFU eviction policy (maxmemory-policy allkeys-lfu or volatile-lfu). Otherwise the RDB file does not contain LFU frequency data and the output will be empty.
前提条件:Redis 实例需配置 LFU 淘汰策略(maxmemory-policy allkeys-lfu 或 volatile-lfu),否则 RDB 中不包含 LFU 频率数据,输出将为空。
rdb -c hotkey -n 50 -o hotkey.csv dump.rdbOutput CSV columns: database, key, type, size, size_readable, freq.
输出 CSV 格式包含:database, key, type, size, size_readable, freq。
📊 Separator-based Prefix Analysis (Streaming / Constant Memory) | 基于分隔符的前缀分析(流式/常量内存模式)
New -prefix-sep flag provides a flat-map-based streaming analysis mode for the prefix command. Compared to the original radix tree implementation, this mode uses constant memory regardless of the number of keys, making it suitable for very large RDB files.
新增 -prefix-sep 参数,为 prefix 命令提供基于 flat map 的流式分析模式。相比原有的 radix tree 实现,该模式内存使用量恒定,不随 Key 数量增长,适用于超大 RDB 文件分析。
# Single separator | 单分隔符
rdb -c prefix -prefix-sep : -n 10 -max-depth 3 -o prefix.csv dump.rdb
# Multiple separators (normalized to the first one) | 多分隔符(会统一归一化到第一个分隔符)
rdb -c prefix -prefix-sep : -prefix-sep . -n 10 -o prefix.csv dump.rdb🗄️ Valkey 9+ (RDB 80) Compatibility | Valkey 9+ (RDB 80) 兼容性支持
-
Support parsing Valkey 9+ RDB files (magic number
VALKEY, RDB version 80) -
Support Valkey-specific
typeHash2encoding (Hash with field-level expiration) -
Support
opCode SlotInfo (244)— Valkey slot metadata, safely skipped during parsing -
Support
opCode SlotImport (243)— Valkey slot import state, safely skipped during parsing -
Encoder support for writing Valkey Hash2 format
-
支持解析 Valkey 9+ 的 RDB 文件(magic number
VALKEY, RDB version 80) -
支持解析 Valkey 特有的
typeHash2编码(Hash with field-level expiration) -
支持
opCode SlotInfo (244)— Valkey slot 元数据,解析时安全跳过 -
支持
opCode SlotImport (243)— Valkey slot import 状态,解析时安全跳过 -
Encoder 支持 Valkey 格式的 Hash2 写入
📈 LFU/LRU Eviction Metadata Support | LFU/LRU 淘汰策略元数据支持
-
Parse
opCodeFreq (249)andopCodeIdle (248)from RDB and store them in the object model -
model.BaseObjectgainsIdleTime(LRU idle time) andFreq(LFU frequency) fields -
New
model.EvictionInfointerface withGetIdleTime()andGetFreq()methods -
JSON output now includes optional
lru/lfufields -
解析 RDB 中的
opCodeFreq (249)和opCodeIdle (248)并存入对象模型 -
model.BaseObject新增IdleTime(LRU 空闲时间)和Freq(LFU 频率)字段 -
新增
model.EvictionInfo接口,提供GetIdleTime()和GetFreq()方法 -
JSON 输出中新增
lru/lfu可选字段
v1.3.1
v1.3.0
v1.2.0
- Support Expiration Filter