示例#1
0
        public virtual ConfigData GetConfig()
        {
            var config = new ConfigData();

            config.Add("metric", GetType().Name);
            config.Add("name", Name);
            config.Add("output_names", OutputNames);
            config.Add("label_names", LabelNames);

            return(config);
        }
示例#2
0
        //添加任务配置
        protected void AddConfig(TEnum type, TaskConfigData config)
        {
            int enumIndex = Enum <TEnum> .Int(type);

            if (ConfigData.ContainsKey(enumIndex))
            {
                CLog.Error("错误!重复AddConfig:{0}", type.ToString());
                return;
            }
            ConfigData.Add(enumIndex, config);
        }
示例#3
0
 public void Set(string name, string value)
 {
     foreach (ValuePair valuePair in ConfigData)
     {
         if (valuePair.Name == name)
         {
             valuePair.Value = value;
             return;
         }
     }
     ConfigData.Add(new ValuePair()
     {
         Name = name, Value = value
     });
 }