class MemFragmentationRatioAlertStrategy extends AlertConfigStrategy {
    
    /**
     * 实例最小500MB才进行内存碎片率检查，否则价值不是很大
     */
    private final static long MIN_CHECK_MEMORY = 500L * 1024 * 1024;
    
    @Override
    public List<InstanceAlertValueResult> checkConfig(InstanceAlertConfig instanceAlertConfig, AlertConfigBaseData alertConfigBaseData) {<FILL_FUNCTION_BODY>}

}

        // 检查内存
        Object usedMemoryObject = getValueFromRedisInfo(alertConfigBaseData.getStandardStats(), RedisInfoEnum.used_memory.getValue());
        long usedMemory = NumberUtils.toLong(usedMemoryObject.toString());
        if (usedMemory < MIN_CHECK_MEMORY) {
            return null;
        }
        
        // 内存碎片率
        Object memFragmentationRatioObject = getValueFromRedisInfo(alertConfigBaseData.getStandardStats(), RedisInfoEnum.mem_fragmentation_ratio.getValue());
        if (memFragmentationRatioObject == null) {
            return null;
        }
        
        // 关系比对
        double memFragmentationRatio = NumberUtils.toDouble(memFragmentationRatioObject.toString());
        boolean compareRight = isCompareDoubleRight(instanceAlertConfig, memFragmentationRatio);
        if (compareRight) {
            return null;
        }
        InstanceInfo instanceInfo = alertConfigBaseData.getInstanceInfo();
        InstanceAlertValueResult instanceAlertValueResult = new InstanceAlertValueResult(instanceAlertConfig, instanceInfo, String.valueOf(memFragmentationRatio),
                instanceInfo.getAppId(), EMPTY);
        instanceAlertValueResult.setOtherInfo(String.format("内存使用为%s MB", String.valueOf(changeByteToMB(usedMemory))));
        return Arrays.asList(instanceAlertValueResult);
    
<methods>public non-sealed void <init>() ,public abstract List<com.sohu.cache.entity.InstanceAlertValueResult> checkConfig(com.sohu.cache.entity.InstanceAlertConfig, com.sohu.cache.alert.bean.AlertConfigBaseData) <variables>protected static final java.lang.String EMPTY,protected static final java.lang.String MB_STRING