fix: redis7.0 监控查询calls数值过大转Intger异常

This commit is contained in:
lanyue52011 2022-07-29 16:48:41 +08:00
parent e52a966b81
commit eb037c963c
2 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@ public class RedisMonitorRespVO {
private String command;
@ApiModelProperty(value = "调用次数", required = true, example = "1024")
private Integer calls;
private Long calls;
@ApiModelProperty(value = "消耗 CPU 秒数", required = true, example = "666")
private Long usec;

View File

@ -22,7 +22,7 @@ public interface RedisConvert {
commandStats.forEach((key, value) -> {
respVO.getCommandStats().add(RedisMonitorRespVO.CommandStat.builder()
.command(StrUtil.subAfter((String) key, "cmdstat_", false))
.calls(Integer.valueOf(StrUtil.subBetween((String) value, "calls=", ",")))
.calls(Long.valueOf(StrUtil.subBetween((String) value, "calls=", ",")))
.usec(Long.valueOf(StrUtil.subBetween((String) value, "usec=", ",")))
.build());
});