网络配置系统前端改造与性能优化

2017-04-21  本文已影响0人  嗷大喵儿

网络配置系统简介

系统存在的问题

系统数据流图--改造前

数据流-改造前

系统数据流图--改造后

数据流-改造后

页面改造前

页面改造前

页面改造后

页面优化后 内置类型支持 修改过程控制

数据结构-改造前

public class NTCache implements Serializable {

public NTCache() {}

@NTRecord(key = "nt.interval")
private int interval;              
@NTRecord(key = "nt.defaulttunnel")
private String defaulttunnel;     

private List<TunnelListItem> tunnelList;

@NTRecord(key = "nt.preblacklist.urlscheme", type = "urlscheme")
private List<PreBlackListItem> preblacklistUrlscheme;     
@NTRecord(key = "nt.preblacklist.contenttype", type = "contenttype")
private List<PreBlackListItem> preblacklistContenttype;   

private List<PreBlackListItem> preblacklist;   

@NTRecord(key = "whitehosts", area = NTArea.APPLOCAL)
private List<String> whitehosts;                          

@NTRecord(key = "specialList.wns", area = NTArea.APPLOCAL, type = "wns")
private List<SpecialListItem> specialListWNS;             
@NTRecord(key = "specialList.cip", area = NTArea.APPLOCAL, type = "cip")
private List<SpecialListItem> specialListCIP;             
@NTRecord(key = "specialList.http", area = NTArea.APPLOCAL, type = "http")
private List<SpecialListItem> specialListHTTP;            

private List<SpecialListItem> specialList;                

@NTRecord(key = "timeout.wns.2G", type = "2G")
private int timeoutWNS2G;               
@NTRecord(key = "timeout.wns.other", type = "other")
private int timeoutWNSOther;            
@NTRecord(key = "timeout.cip.2G", type = "2G")
private int timeoutCIP2G;               
@NTRecord(key = "timeout.cip.other", type = "other")
private int timeoutCIPOther;            
@NTRecord(key = "timeout.cip.udphold.2G", type = "2G")
private int timeoutCIPUdphold2G;        
@NTRecord(key = "timeout.cip.udphold.other", type = "other")
private int timeoutCIPUdpholdOther;     
@NTRecord(key = "timeout.cip.httphold.2G", type = "2G")
private int timeoutCIPHttphold2G;       
@NTRecord(key = "timeout.cip.httphold.2G.other", type = "other")
private int timeoutCIPHttpholdOther;    
@NTRecord(key = "timeout.http.2G", type = "2G")
private int timeoutHTTP2G;              
@NTRecord(key = "timeout.http.other", type = "other")
private int timeoutHTTPOther;           

private List<ExtraListItem> extraList;

}

数据结构-改造后

@Data
public class ConfigCache implements Serializable, Comparable<ConfigCache> {
    private String key;

    private Object value;  //数据已经过转型,为string/integer/boolean/list

    private String platform;  // all/android/ios

    private String sdkVersion;  

    private String beginVersion;  //app begin version

    private String endVersion;  // app end version

    private int orderNo;

    private List<CityRange> cityRanges;  
}

@Data
public class AppConfigCache implements Serializable {
    /**
     * 全局和特定APP
     */
    private List<ConfigCache> tunnel;

    /**
     * 全局和特定APP
     */
    private List<ConfigCache> others;

    /**
     * 全局filter, 特定APP specialList
     */
    private List<ConfigCache> filterOrSpecialList;

    /**
     * 全局timeout, 特定APP hosts
     */
    private List<ConfigCache> timeOutOrHosts;
}

@Getter
@Setter
public class AppConfigVersionCache implements Serializable {
    private AppConfigCache cache;

    private int version;
}

新旧数据分发过程对比

改造成果

作者感悟

上一篇 下一篇

猜你喜欢

热点阅读