oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/CacheReadLatencyThresholdsAndWatcher.java [38:78]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        thresholds = new AtomicReference<>(new HashMap<>());
        initialSettingsString = config;

        activeSetting(config);
    }

    private void activeSetting(String config) {
        Map<String, Integer> newThresholds = new HashMap<>();
        List<String> settings = Splitter.on(',').splitToList(config);
        for (String setting : settings) {
            List<String> typeValue = Splitter.on(":").splitToList(setting);
            if (typeValue.size() == 2) {
                newThresholds.put(typeValue.get(0).trim().toLowerCase(), Integer.parseInt(typeValue.get(1).trim()));
            }
        }
        thresholds.set(newThresholds);
    }

    public int getThreshold(String type) {
        type = type.toLowerCase();
        if (thresholds.get().containsKey(type)) {
            return thresholds.get().get(type);
        } else {
            return Optional.ofNullable(thresholds.get().get("default")).orElse(Integer.MAX_VALUE);
        }
    }

    @Override
    public void notify(ConfigChangeEvent value) {
        if (EventType.DELETE.equals(value.getEventType())) {
            dynamicSettingsString = null;
            activeSetting(initialSettingsString);
        } else {
            dynamicSettingsString = value.getNewValue();
            activeSetting(value.getNewValue());
        }
    }

    @Override
    public String value() {
        return dynamicSettingsString;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/CacheWriteLatencyThresholdsAndWatcher.java [38:78]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        thresholds = new AtomicReference<>(new HashMap<>());
        initialSettingsString = config;

        activeSetting(config);
    }

    private void activeSetting(String config) {
        Map<String, Integer> newThresholds = new HashMap<>();
        List<String> settings = Splitter.on(',').splitToList(config);
        for (String setting : settings) {
            List<String> typeValue = Splitter.on(":").splitToList(setting);
            if (typeValue.size() == 2) {
                newThresholds.put(typeValue.get(0).trim().toLowerCase(), Integer.parseInt(typeValue.get(1).trim()));
            }
        }
        thresholds.set(newThresholds);
    }

    public int getThreshold(String type) {
        type = type.toLowerCase();
        if (thresholds.get().containsKey(type)) {
            return thresholds.get().get(type);
        } else {
            return Optional.ofNullable(thresholds.get().get("default")).orElse(Integer.MAX_VALUE);
        }
    }

    @Override
    public void notify(ConfigChangeEvent value) {
        if (EventType.DELETE.equals(value.getEventType())) {
            dynamicSettingsString = null;
            activeSetting(initialSettingsString);
        } else {
            dynamicSettingsString = value.getNewValue();
            activeSetting(value.getNewValue());
        }
    }

    @Override
    public String value() {
        return dynamicSettingsString;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



