feat: Add Keyspace hits metrics for set #2579
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
修改内容
1.新增keyspace_hits、keyspace_misses指标
2.修改了set相关命令的返回结果,使得keyspace_hits、keyspace_misses可以正确统计
3.新增了go测试
需要审查的点
说明
这次改动主要为了在pika支持keyspace hit相关参数。 关联的issue: #2423
参考redis的实现: redis在执行操作前会统一在内存查找key是否存在并统计
但在pika这一层,需要在各个命令执行阶段实现统计。
即,当key不存在时s_.IsNotFound()==true。
当前只修改set,后续还需要将其他的数据类型命令全部修改。
异常返回统计表
当前版本由于storage层部分s_.IsNotFound()接口返回结果不适配,导致部分命令的返回结果会超出预期,这里是相关列表。